GNU bug report logs - #29179
[PATCH] teach recover-file about autosave files not existing

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Mon, 6 Nov 2017 21:23:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29179 in the body.
You can then email your comments to 29179 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29179; Package emacs. (Mon, 06 Nov 2017 21:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Nov 2017 21:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] teach recover-file about autosave files not existing
Date: Mon, 06 Nov 2017 15:22:46 -0600
[Message part 1 (text/plain, inline)]
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 <at> 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

[0001-Add-more-informative-error-when-no-autosave-file-ava.patch (text/x-diff, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 24 Nov 2017 09:03:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Branham <alex.branham <at> gmail.com>:
bug acknowledged by developer. (Fri, 24 Nov 2017 09:03:03 GMT) Full text and rfc822 format available.

Message #10 received at 29179-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 29179-done <at> debbugs.gnu.org
Subject: Re: bug#29179: [PATCH] teach recover-file about autosave files not
 existing
Date: Fri, 24 Nov 2017 11:01:28 +0200
> From: Alex Branham <alex.branham <at> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Dec 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.