Commit 10f7c7fc authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

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

parent a7a39fbe
...@@ -1982,15 +1982,10 @@ beginning and `after-revert-hook' at the end." ...@@ -1982,15 +1982,10 @@ beginning and `after-revert-hook' at the end."
(defun recover-file (file) (defun recover-file (file)
"Visit file FILE, but get contents from its last auto-save file." "Visit file FILE, but get contents from its last auto-save file."
(interactive ;; Actually putting the file name in the minibuffer should be used
(let ((prompt-file buffer-file-name) ;; only rarely.
(file-name nil) ;; Not just because users often use the default.
(file-dir nil)) (interactive "fRecover file: ")
(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))))
(setq file (expand-file-name file)) (setq file (expand-file-name file))
(if (auto-save-file-name-p (file-name-nondirectory file)) (if (auto-save-file-name-p (file-name-nondirectory file))
(error "%s is an auto-save file" file)) (error "%s is an auto-save file" file))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment