From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Subject: buffer-file-name in [* Org src *] buffers Date: Sun, 11 Mar 2018 18:56:48 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev9td-0007gD-Cn for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 18:56:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev9tc-00028i-A0 for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 18:56:53 -0400 Received: from mail-qt0-x229.google.com ([2607:f8b0:400d:c0d::229]:46006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ev9tc-00028S-4L for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 18:56:52 -0400 Received: by mail-qt0-x229.google.com with SMTP id v90so16919710qte.12 for ; Sun, 11 Mar 2018 15:56:51 -0700 (PDT) Received: from ?IPv6:2601:184:4180:66e7:ac91:cb89:998d:8033? ([2601:184:4180:66e7:ac91:cb89:998d:8033]) by smtp.gmail.com with ESMTPSA id y66sm1567911qky.88.2018.03.11.15.56.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Mar 2018 15:56:50 -0700 (PDT) Content-Language: en-GB List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi all, TL;DR: why does org-src-mode-configure-edit-buffer set buffer-file-name to a non-nil value? https://code.orgmode.org/bzg/org-mode/commit/4b6988bf36cb458c9d113ee4332e016990c1eb04#diff-ea848b037ba2c0bf95915700bb6f4e539d80d8cR486 Background information: I'm reviewing a patch (https://github.com/flycheck/flycheck/pull/1426) to enable Flycheck in temporary buffers created by org-mode while editing a code snippet with org-edit-src-code (among others). The patch teaches Flycheck to append an checker-appropriate extension to the temporary files that it creates: for example, when editing a Python snippet from an Org file, Flycheck would now create a file named /tmp/.py instead of /tmp/ (which would make Python happy). We're thinking of enabling this automatic suffix addition behavior only for buffers that do not have a buffer-file-name currently set (in the ones that do, Flycheck already derives file names for its temporary files from the buffer's file name), but we were surprised to find that [* Org src *] actually have a buffer-file-name. Why is that? Thanks, Clément.