1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

(recover-file): Use ordinary `f' to read file name.

This commit is contained in:
Richard M. Stallman 1995-02-10 06:29:31 +00:00
parent a7a39fbe87
commit 10f7c7fc29

View File

@ -1982,15 +1982,10 @@ beginning and `after-revert-hook' at the end."
(defun recover-file (file)
"Visit file FILE, but get contents from its last auto-save file."
(interactive
(let ((prompt-file buffer-file-name)
(file-name nil)
(file-dir nil))
(and prompt-file
(setq file-name (file-name-nondirectory prompt-file)
file-dir (file-name-directory prompt-file)))
(list (read-file-name "Recover file: "
file-dir nil nil file-name))))
;; Actually putting the file name in the minibuffer should be used
;; only rarely.
;; Not just because users often use the default.
(interactive "fRecover file: ")
(setq file (expand-file-name file))
(if (auto-save-file-name-p (file-name-nondirectory file))
(error "%s is an auto-save file" file))