]> git.eshelyaron.com Git - emacs.git/commitdiff
(view-file, view-file-other-window, view-file-other-frame):
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 31 May 2003 17:53:24 +0000 (17:53 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 31 May 2003 17:53:24 +0000 (17:53 +0000)
Signal an error when trying to visit an inexistent file.

lisp/view.el

index cf9db5293393386e2524d06f158419f7019b8452..2ef84d2351071838a92ebb95a555f6bcc9aae264 100644 (file)
@@ -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))))