From 16876744d44b07ab9486fcea388254b9b8f617a5 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 30 Jul 2021 14:07:04 +0200 Subject: [PATCH] Ensure that recover-file doesn't leave stale auto-save files behind * lisp/files.el (recover-file): Don't leave stale auto-save files behind after crash recovery (bug#11331). --- lisp/files.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index 0bf866d0ece..2b13d04bcbe 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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")))))