From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: buffer-file-name in [* Org src *] buffers Date: Mon, 12 Mar 2018 11:47:23 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c13f248baa68e05672f0127" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evERI-0007o0-5z for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 23:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evERG-0001H8-SK for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 23:47:56 -0400 Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:36671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evERG-0001Gq-K1 for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 23:47:54 -0400 Received: by mail-oi0-x22e.google.com with SMTP id u73so11216562oie.3 for ; Sun, 11 Mar 2018 20:47:54 -0700 (PDT) In-Reply-To: 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: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= Cc: Org-mode --94eb2c13f248baa68e05672f0127 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I agree, should compatible with situations like `flycheck` need to use buffer-file-name. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Mon, Mar 12, 2018 at 6:56 AM, Cl=C3=A9ment Pit-Claudel wrote: > 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 a= n > checker-appropriate extension to the temporary files that it creates: for > example, when editing a Python snippet from an Org file, Flycheck would n= ow > 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 one= s > 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=C3=A9ment. > > > > --94eb2c13f248baa68e05672f0127 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I agree, should compatible with situations like `flych= eck` need to use buffer-file-name.

[stardiviner]=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this world!>= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeenode): star= diviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild<= br>Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2= 433
Blog: ht= tp://stardiviner.github.io/

On Mon, Mar 12, 2018 at 6:56 AM, Cl=C3=A9men= t Pit-Claudel <cpitclaudel@gmail.com> wrote:
Hi all,

TL;DR: why does org-src-mode-configure-edit-buffer set buffer-file-nam= e to a non-nil value?=C2=A0 https://code.= orgmode.org/bzg/org-mode/commit/4b6988bf36cb458c9d113ee4332e016990c1eb04#diff-ea848b037ba2c0bf95915700bb6f4e539d80d8cR486=

Background information: I'm reviewing a patch (htt= ps://github.com/flycheck/flycheck/pull/1426) to enable Flycheck in= temporary buffers created by org-mode while editing a code snippet with or= g-edit-src-code (among others).=C2=A0 The patch teaches Flycheck to append = an checker-appropriate extension to the temporary files that it creates: fo= r example, when editing a Python snippet from an Org file, Flycheck would n= ow create a file named /tmp/<random string>.py instead of /tmp/<ra= ndom string> (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=C2=A0 file name), but we were surprised to find that [* Or= g src *] actually have a buffer-file-name.

Why is that?

Thanks,
Cl=C3=A9ment.




--94eb2c13f248baa68e05672f0127--