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

(dired-find-file): Error if line's file does not exist.

parent 9663837a
......@@ -1173,7 +1173,10 @@ Creates a buffer if necessary."
(defun dired-find-file ()
"In dired, visit the file or directory named on this line."
(interactive)
(find-file (file-name-sans-versions (dired-get-filename) t)))
(let ((file-name (file-name-sans-versions (dired-get-filename) t)))
(if (file-exists-p file-name)
(find-file file-name)
(error "File no longer exists; type `g' to update Dired buffer"))))
(defun dired-mouse-find-file-other-window (event)
"In dired, visit the file or directory name you click on."
......
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