From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21612: 24.5; Configuration variable to delete auto-save file when intentionally killing buffer Date: Wed, 18 Aug 2021 16:34:14 +0300 Message-ID: <83sfz6512h.fsf@gnu.org> References: <87im05d0rr.fsf@gnus.org> <83fsv98roh.fsf@gnu.org> <878s11a44w.fsf@gnus.org> <838s118opm.fsf@gnu.org> <87k0kidiqm.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23652"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 21612@debbugs.gnu.org, mrok4a@gmail.com, rms@gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 18 15:35:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGLio-0005uZ-SB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 15:35:10 +0200 Original-Received: from localhost ([::1]:46892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGLin-0007Z7-U6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 09:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGLig-0007VV-He for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGLig-0002KV-A9 for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGLig-0006hW-7e for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Aug 2021 13:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21612 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 21612-submit@debbugs.gnu.org id=B21612.162929367825669 (code B ref 21612); Wed, 18 Aug 2021 13:35:02 +0000 Original-Received: (at 21612) by debbugs.gnu.org; 18 Aug 2021 13:34:38 +0000 Original-Received: from localhost ([127.0.0.1]:55273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGLiI-0006fx-9P for submit@debbugs.gnu.org; Wed, 18 Aug 2021 09:34:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGLiF-0006fe-Sd for 21612@debbugs.gnu.org; Wed, 18 Aug 2021 09:34:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:47360) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGLiA-00022R-CU; Wed, 18 Aug 2021 09:34:30 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1865 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGLhw-0002lF-4t; Wed, 18 Aug 2021 09:34:16 -0400 In-Reply-To: <87k0kidiqm.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 18 Aug 2021 14:45:21 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212139 Archived-At: > From: Lars Ingebrigtsen > Cc: mrok4a@gmail.com, 21612@debbugs.gnu.org, Richard M. Stallman > Date: Wed, 18 Aug 2021 14:45:21 +0200 > > diff --git a/src/buffer.c b/src/buffer.c > --- a/src/buffer.c > +++ b/src/buffer.c > @@ -1370,11 +1370,13 @@ > - /* Delete any auto-save file, if we saved it in this session. */ > + /* Delete any auto-save file, if we saved it in this session. > + But not if the buffer is modified. */ > if (STRINGP (b->auto_save_file_name) > && b->auto_save_modified != 0 > - && BUF_SAVE_MODIFF (b) < b->auto_save_modified) > + && BUF_SAVE_MODIFF (b) < b->auto_save_modified > + && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) > { > Lisp_Object tem; > tem = Fsymbol_value (intern ("delete-auto-save-files")); > if (! NILP (tem)) > internal_delete_file (b->auto_save_file_name); > } > > No now this option is basically pointless (when killing buffers) -- the > only reason we'd want to delete an auto-save file is if the buffer is > modified. Otherwise there won't be an auto-save file. (Except when > it's made by a different Emacs, and in that case, we really shouldn't be > deleting it anyway.) We could make that variable have a third value, which would then override the above logic, no? > The commit message or the comments don't explain what the reasoning > behind changing the semantics here were. > > Richard, do you have any recollection why you made these changes 20 > years ago? They seem to make the delete-auto-save-files variable in a > kill-buffer context pointless. I guess the reason was the fear of losing edits, as discussed previously. But if the user explicitly wants to take those risks, it's okay, especially if we ask for confirmation.