diff options
| author | Richard M. Stallman | 2002-08-15 20:08:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-08-15 20:08:24 +0000 |
| commit | 64d18e8f147643d45dc05ba227bf9a5fab84adf0 (patch) | |
| tree | afc14902bba025bf2cd6f7340e79d99ff6ad0688 | |
| parent | 70c06e3955a2970576310a8aa05f483564f622aa (diff) | |
| download | emacs-64d18e8f147643d45dc05ba227bf9a5fab84adf0.tar.gz emacs-64d18e8f147643d45dc05ba227bf9a5fab84adf0.zip | |
(recover-this-file): New function.
(after-find-file): Recommend recover-this-file.
| -rw-r--r-- | lisp/files.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index 98cf8bfae56..b2b75ac3cd7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1406,7 +1406,7 @@ unless NOMODES is non-nil." | |||
| 1406 | (file-newer-than-file-p (or buffer-auto-save-file-name | 1406 | (file-newer-than-file-p (or buffer-auto-save-file-name |
| 1407 | (make-auto-save-file-name)) | 1407 | (make-auto-save-file-name)) |
| 1408 | buffer-file-name)) | 1408 | buffer-file-name)) |
| 1409 | (format "%s has auto save data; consider M-x recover-file" | 1409 | (format "%s has auto save data; consider M-x recover-this-file" |
| 1410 | (file-name-nondirectory buffer-file-name)) | 1410 | (file-name-nondirectory buffer-file-name)) |
| 1411 | (setq not-serious t) | 1411 | (setq not-serious t) |
| 1412 | (if error "(New file)" nil))) | 1412 | (if error "(New file)" nil))) |
| @@ -3335,6 +3335,11 @@ non-nil, it is called instead of rereading visited file contents." | |||
| 3335 | (run-hooks 'revert-buffer-internal-hook)) | 3335 | (run-hooks 'revert-buffer-internal-hook)) |
| 3336 | t))))) | 3336 | t))))) |
| 3337 | 3337 | ||
| 3338 | (defun recover-this-file () | ||
| 3339 | "Recover the visited file--get contents from its last auto-save file." | ||
| 3340 | (interactive) | ||
| 3341 | (recover-file buffer-file-name)) | ||
| 3342 | |||
| 3338 | (defun recover-file (file) | 3343 | (defun recover-file (file) |
| 3339 | "Visit file FILE, but get contents from its last auto-save file." | 3344 | "Visit file FILE, but get contents from its last auto-save file." |
| 3340 | ;; Actually putting the file name in the minibuffer should be used | 3345 | ;; Actually putting the file name in the minibuffer should be used |