emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 64b4c85: Fix up deleting auto-save/killing buffer wrt. `auto-save


From: Lars Ingebrigtsen
Subject: master 64b4c85: Fix up deleting auto-save/killing buffer wrt. `auto-save-visited-mode'
Date: Wed, 25 Aug 2021 05:58:34 -0400 (EDT)

branch: master
commit 64b4c85637d9d5aa98ddc4f006f24cbd28727416
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix up deleting auto-save/killing buffer wrt. `auto-save-visited-mode'
    
    * src/buffer.c (Fkill_buffer): Respect `auto-save-visited-mode'.
---
 src/buffer.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 5951040..100ebc7 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1798,11 +1798,15 @@ cleaning up all windows currently displaying the buffer 
to be killed. */)
 
     /* Delete the autosave file, if requested. */
     if (modified
-       && STRINGP (BVAR (b, auto_save_file_name))
-       && !NILP (Ffile_exists_p (BVAR (b, auto_save_file_name)))
        && kill_buffer_delete_auto_save_files
        && delete_auto_save_files
-       && !NILP (Frecent_auto_save_p ()))
+       && !NILP (Frecent_auto_save_p ())
+       && STRINGP (BVAR (b, auto_save_file_name))
+       && !NILP (Ffile_exists_p (BVAR (b, auto_save_file_name)))
+       /* If `auto-save-visited-mode' is on, then we're auto-saving
+          to the visited file -- don't delete it.. */
+       && NILP (Fstring_equal (BVAR (b, auto_save_file_name),
+                               BVAR (b, filename))))
       {
        tem = do_yes_or_no_p (build_string ("Delete auto-save file? "));
        if (!NILP (tem))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]