bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#29179: [PATCH] teach recover-file about autosave files not existing


From: Alex Branham
Subject: bug#29179: [PATCH] teach recover-file about autosave files not existing
Date: Mon, 06 Nov 2017 15:22:46 -0600
User-agent: mu4e 0.9.18; emacs 25.3.1

Currently running M-x recover-this-file when an autosave file doesn't exist 
reports that the autosave file is not current. This changes it so that it'll 
correctly tell you that the autosave file doesn't exist.

Alex

------------------------------------------------------------

>From f0b3de73ba72ada91c3efe2d150b606d35ca4e5c Mon Sep 17 00:00:00 2001
From: Alex Branham <branham@utexas.edu>
Date: Mon, 6 Nov 2017 15:17:40 -0600
Subject: [PATCH] Add more informative error when no autosave file available

* lisp/files.el (recover-file): Distinguish between autosave file
not existing versus not being current
---
 lisp/files.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index cda2c1abd5..1bd0ba6427 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5851,7 +5851,11 @@ recover-file
       (error "%s is an auto-save file" (abbreviate-file-name file)))
   (let ((file-name (let ((buffer-file-name file))
                     (make-auto-save-file-name))))
-    (cond ((if (file-exists-p file)
+    (cond ((and (file-exists-p file)
+                (not (file-exists-p file-name)))
+           (error "No auto save file %s found"
+                  (abbreviate-file-name file-name)))
+          ((if (file-exists-p file)
               (not (file-newer-than-file-p file-name file))
             (not (file-exists-p file-name)))
           (error "Auto-save file %s not current"
-- 
2.15.0

Attachment: 0001-Add-more-informative-error-when-no-autosave-file-ava.patch
Description: Text Data


reply via email to

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