From c439687b4d3a617dbdb8e90e401a9db17d08426d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 31 Oct 1996 20:51:44 +0000 Subject: [PATCH] (dired-find-file): Error if line's file does not exist. --- lisp/dired.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index 7644887d103..679d82936e7 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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." -- 2.39.2