From 981b7b0c72ffd10fb0cad9143258f99a4f9fb97b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 31 May 2003 17:53:24 +0000 Subject: [PATCH] (view-file, view-file-other-window, view-file-other-frame): Signal an error when trying to visit an inexistent file. --- lisp/view.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/view.el b/lisp/view.el index cf9db529339..2ef84d23510 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -242,6 +242,7 @@ For list of all View commands, type H or h while viewing. This command runs the normal hook `view-mode-hook'." (interactive "fView file: ") + (unless (file-exists-p file) (error "%s does not exist" file)) (let ((had-a-buf (get-file-buffer file))) (view-buffer (find-file-noselect file) (and (not had-a-buf) 'kill-buffer)))) @@ -258,6 +259,7 @@ For list of all View commands, type H or h while viewing. This command runs the normal hook `view-mode-hook'." (interactive "fIn other window view file: ") + (unless (file-exists-p file) (error "%s does not exist" file)) (let ((had-a-buf (get-file-buffer file))) (view-buffer-other-window (find-file-noselect file) nil (and (not had-a-buf) 'kill-buffer)))) @@ -274,6 +276,7 @@ For list of all View commands, type H or h while viewing. This command runs the normal hook `view-mode-hook'." (interactive "fIn other frame view file: ") + (unless (file-exists-p file) (error "%s does not exist" file)) (let ((had-a-buf (get-file-buffer file))) (view-buffer-other-frame (find-file-noselect file) nil (and (not had-a-buf) 'kill-buffer)))) -- 2.39.5