diff lisp/view.el @ 51371:463499edca88

(view-file, view-file-other-window, view-file-other-frame): Signal an error when trying to visit an inexistent file.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 31 May 2003 17:53:24 +0000
parents 01b16e9a75fb
children 2ec7d96e306e
line wrap: on
line diff
--- 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))))