diff options
| author | Glenn Morris | 2017-03-01 18:29:48 -0500 |
|---|---|---|
| committer | Glenn Morris | 2017-03-01 18:29:48 -0500 |
| commit | 8244357283b740adacaa4526c0ea60349b0a93bb (patch) | |
| tree | 107de2e8ace587669736f2b8f62654cec2b508d6 | |
| parent | 79abec2feefa6169b8073cacde98a02d8087c19b (diff) | |
| download | emacs-8244357283b740adacaa4526c0ea60349b0a93bb.tar.gz emacs-8244357283b740adacaa4526c0ea60349b0a93bb.zip | |
Small recover-this-file improvement
* lisp/files.el (recover-this-file): Explicit error if not
visiting a file. (Bug#23671)
| -rw-r--r-- | lisp/files.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index 7c9271e2f44..c7de4453d75 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -5838,6 +5838,8 @@ an auto-save file." | |||
| 5838 | (defun recover-this-file () | 5838 | (defun recover-this-file () |
| 5839 | "Recover the visited file--get contents from its last auto-save file." | 5839 | "Recover the visited file--get contents from its last auto-save file." |
| 5840 | (interactive) | 5840 | (interactive) |
| 5841 | (or buffer-file-name | ||
| 5842 | (user-error "This buffer is not visiting a file")) | ||
| 5841 | (recover-file buffer-file-name)) | 5843 | (recover-file buffer-file-name)) |
| 5842 | 5844 | ||
| 5843 | (defun recover-file (file) | 5845 | (defun recover-file (file) |