all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21612@debbugs.gnu.org, mrok4a@gmail.com,
	"Richard M. Stallman" <rms@gnu.org>
Subject: bug#21612: 24.5; Configuration variable to delete auto-save file when intentionally killing buffer
Date: Wed, 18 Aug 2021 14:45:21 +0200	[thread overview]
Message-ID: <87k0kidiqm.fsf@gnus.org> (raw)
In-Reply-To: <838s118opm.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Aug 2021 17:10:45 +0300")

Argh!

I now implemented this...  but then I discovered the
delete-auto-save-files variable, which seems to be providing just what
was requested here, just about.

And it worked in the initial revision:

commit 1ab256cb9997cf15983abc63310cdf32f0533bca
Author:     Roland McGrath <roland@gnu.org>
AuthorDate: Mon Jul 15 21:27:11 1991 +0000

    Initial revision

diff --git a/src/buffer.c b/src/buffer.c
--- /dev/null
+++ b/src/buffer.c
@@ -0,0 +678,9 @@
+  /* Delete any auto-save file.  */
+  if (XTYPE (b->auto_save_file_name) == Lisp_String)
+    {
+      Lisp_Object tem;
+      tem = Fsymbol_value (intern ("delete-auto-save-files"));
+      if (! NULL (tem))
+	unlink (XSTRING (b->auto_save_file_name)->data);
+    }
+

But Richard changed this in 2001:

commit 9cf712eb57c0a1fef56487508e89d08c91f98db1
Author:     Richard M. Stallman <rms@gnu.org>
AuthorDate: Tue Nov 6 04:48:15 2001 +0000

    (Fkill_buffer): Don't delete auto save file if buffer is modified.

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.)

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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  parent reply	other threads:[~2021-08-18 12:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03 14:51 bug#21612: 24.5; Configuration variable to delete auto-save file when intentionally killing buffer Marcus
2015-10-03 17:03 ` Eli Zaretskii
2015-10-03 17:53   ` Marcus
2015-10-03 18:00     ` Eli Zaretskii
2021-08-16 12:36 ` Lars Ingebrigtsen
2021-08-16 13:06   ` Eli Zaretskii
2021-08-16 13:52     ` Lars Ingebrigtsen
2021-08-16 14:10       ` Eli Zaretskii
2021-08-16 18:48         ` Lars Ingebrigtsen
2021-08-18 12:45         ` Lars Ingebrigtsen [this message]
2021-08-18 13:34           ` Eli Zaretskii
2021-08-18 13:38             ` Lars Ingebrigtsen
2021-08-18 13:48               ` Eli Zaretskii
2021-08-18 14:31                 ` Lars Ingebrigtsen
2021-08-18 16:13                   ` Eli Zaretskii
2021-08-18 16:41                     ` Lars Ingebrigtsen
2021-08-18 16:44                       ` Eli Zaretskii
2021-08-19 13:05                         ` Lars Ingebrigtsen
2021-08-20  6:23                           ` Eli Zaretskii
2021-08-20 13:29                             ` Lars Ingebrigtsen
2021-08-22  9:29                               ` Eli Zaretskii
2021-08-22 21:55                                 ` Lars Ingebrigtsen
2021-08-23 12:21                                   ` Eli Zaretskii
2021-08-23 13:58                                     ` Lars Ingebrigtsen
2021-08-23 16:24                                       ` Eli Zaretskii
2021-08-23 16:40                                         ` Lars Ingebrigtsen
2021-08-23 18:57                                           ` Eli Zaretskii
2021-08-25  9:58                                             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0kidiqm.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=21612@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mrok4a@gmail.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.