# HG changeset patch # User Stefan Monnier # Date 1054403604 0 # Node ID 463499edca88e5b34ce130e3110421fadf069987 # Parent a7a449bb9443b96b5e42afc7a5c79cfb41073c1c (view-file, view-file-other-window, view-file-other-frame): Signal an error when trying to visit an inexistent file. diff -r a7a449bb9443 -r 463499edca88 lisp/view.el --- a/lisp/view.el Sat May 31 17:43:28 2003 +0000 +++ b/lisp/view.el Sat May 31 17:53:24 2003 +0000 @@ -242,6 +242,7 @@ 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 @@ 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 @@ 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))))