unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29179: [PATCH] teach recover-file about autosave files not existing
@ 2017-11-06 21:22 Alex Branham
  2017-11-24  9:01 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Branham @ 2017-11-06 21:22 UTC (permalink / raw)
  To: 29179

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-more-informative-error-when-no-autosave-file-ava.patch --]
[-- Type: text/x-diff, Size: 1137 bytes --]

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#29179: [PATCH] teach recover-file about autosave files not existing
  2017-11-06 21:22 bug#29179: [PATCH] teach recover-file about autosave files not existing Alex Branham
@ 2017-11-24  9:01 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2017-11-24  9:01 UTC (permalink / raw)
  To: Alex Branham; +Cc: 29179-done

> From: Alex Branham <alex.branham@gmail.com>
> Date: Mon, 06 Nov 2017 15:22:46 -0600
> 
> 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.

Thanks, I pushed this to the master branch.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-24  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 21:22 bug#29179: [PATCH] teach recover-file about autosave files not existing Alex Branham
2017-11-24  9:01 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).