From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: buffer-file-name in [* Org src *] buffers Date: Wed, 14 Mar 2018 20:57:53 +0100 Message-ID: <87y3iujupq.fsf@nicolasgoaziou.fr> References: <87ina1cqaf.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewCXA-00009Z-KZ for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 15:58:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewCX7-00085d-Jm for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 15:58:00 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:38301) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewCX7-00082s-CA for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 15:57:57 -0400 In-Reply-To: (=?utf-8?Q?=22Cl=C3=A9ment?= Pit-Claudel"'s message of "Wed, 14 Mar 2018 10:18:55 -0400") 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-Claudel Cc: emacs-orgmode@gnu.org Hello, Cl=C3=A9ment Pit-Claudel writes: > 1. Set buffer-offer-save to 'always; this guarantees that C-x s will ask = about the edit buffer. > 2. Add an entry to kill-buffer-query-functions. For example, with-editor= (used by magit) does this: > (add-hook 'kill-buffer-query-functions > 'with-editor-kill-buffer-noop nil t) > > With these, we could leave buffer-file-name to nil. > > WDYT? `buffer-offer-save' is already set to a non-nil value. See `org-src-mode-configure-edit-buffer'. > PS: point (1) shares an issue with the original implementation (it > always prompts during save-some-buffers). One fix to this could be to > add a buffer-modification-hook that marks the source buffer as modified > when the edit buffer is modified, and to make change the source buffer's > write-contents-functions to offer to save edit buffers too. Right. Then we might as well use the second solution instead, and leave out both `buffer-file-name' and `buffer-offer-save'. So, would you want to implement it? Regards, --=20 Nicolas Goaziou 0x80A93738