From: Stefan Monnier Date: Sat, 31 May 2003 17:53:24 +0000 (+0000) Subject: (view-file, view-file-other-window, view-file-other-frame): X-Git-Tag: ttn-vms-21-2-B4~9821 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=981b7b0c72ffd10fb0cad9143258f99a4f9fb97b;p=emacs.git (view-file, view-file-other-window, view-file-other-frame): Signal an error when trying to visit an inexistent file. --- 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))))