]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure that recover-file doesn't leave stale auto-save files behind
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 30 Jul 2021 12:07:04 +0000 (14:07 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 30 Jul 2021 12:07:04 +0000 (14:07 +0200)
* lisp/files.el (recover-file): Don't leave stale auto-save files
behind after crash recovery (bug#11331).

lisp/files.el

index 0bf866d0eceafbe0ece5004c03d665fa09ff5614..2b13d04bcbef0a77bfec46c3cdebf5c695bd10fd 100644 (file)
@@ -6615,7 +6615,8 @@ details on the arguments, see `revert-buffer'."
                 (coding-system-for-read 'auto-save-coding))
             (erase-buffer)
             (insert-file-contents file-name nil)
-            (set-buffer-file-coding-system coding-system))
+            (set-buffer-file-coding-system coding-system)
+             (set-buffer-auto-saved))
           (after-find-file nil nil t))
          (t (user-error "Recover-file canceled")))))