GNU bug report logs - #23671
25.0.94; recover-this-file error

Previous Next

Package: emacs;

Reported by: Live System User <nyc4bos <at> aol.com>

Date: Wed, 1 Jun 2016 11:32:01 UTC

Severity: minor

Found in version 25.0.94

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Glenn Morris <rgm <at> gnu.org>
To: 23671-done <at> debbugs.gnu.org
Subject: Re: bug#23671: 25.0.94; recover-this-file error
Date: Wed, 01 Mar 2017 18:31:14 -0500
Version: 26.1

Live System User wrote:

> I saw a message from Emacs that I could recover a file. I switched to
> another buffer to check out something but didn't switch back when I
> invoked `recover-this-file' and got the error:
>
>              Wrong type argument: stringp, nil

commit 8244357
Date:   Wed Mar 1 18:29:48 2017 -0500

    Small recover-this-file improvement
    
    * lisp/files.el (recover-this-file): Explicit error if not
    visiting a file.  (Bug#23671)

diff --git a/lisp/files.el b/lisp/files.el
index 7c9271e..c7de445 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5838,6 +5838,8 @@ an auto-save file."
 (defun recover-this-file ()
   "Recover the visited file--get contents from its last auto-save file."
   (interactive)
+  (or buffer-file-name
+      (user-error "This buffer is not visiting a file"))
   (recover-file buffer-file-name))
 
 (defun recover-file (file)




This bug report was last modified 8 years and 88 days ago.

Previous Next


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