]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-find-file): Error if line's file does not exist.
authorRichard M. Stallman <rms@gnu.org>
Thu, 31 Oct 1996 20:51:44 +0000 (20:51 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 31 Oct 1996 20:51:44 +0000 (20:51 +0000)
lisp/dired.el

index 7644887d103baea36644db957dcdd487d76ac34e..679d82936e7e39ed8fc9d137f89a86aede94afbd 100644 (file)
@@ -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."