Mercurial > emacs
comparison lisp/files.el @ 46905:23b6ab646d7b
(recover-this-file): New function.
(after-find-file): Recommend recover-this-file.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 15 Aug 2002 20:08:24 +0000 |
parents | b00b63ab095b |
children | 39b2e060a7f0 |
comparison
equal
deleted
inserted
replaced
46904:7af0f250bfd0 | 46905:23b6ab646d7b |
---|---|
1404 (not (and buffer-file-name | 1404 (not (and buffer-file-name |
1405 auto-save-visited-file-name)) | 1405 auto-save-visited-file-name)) |
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))) |
1413 ((not error) | 1413 ((not error) |
1414 (setq not-serious t) | 1414 (setq not-serious t) |
3333 (setq revert-buffer-internal-hook local-hook)) | 3333 (setq revert-buffer-internal-hook local-hook)) |
3334 (kill-local-variable 'revert-buffer-internal-hook)) | 3334 (kill-local-variable 'revert-buffer-internal-hook)) |
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 |
3341 ;; only rarely. | 3346 ;; only rarely. |
3342 ;; Not just because users often use the default. | 3347 ;; Not just because users often use the default. |