aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2003-05-31 17:53:24 +0000
committerStefan Monnier2003-05-31 17:53:24 +0000
commit981b7b0c72ffd10fb0cad9143258f99a4f9fb97b (patch)
tree495088609f7ffe8330feb85b9156f02d68d537ee
parent0bfb74a943d961d524985db540500fdd53574c5f (diff)
downloademacs-981b7b0c72ffd10fb0cad9143258f99a4f9fb97b.tar.gz
emacs-981b7b0c72ffd10fb0cad9143258f99a4f9fb97b.zip
(view-file, view-file-other-window, view-file-other-frame):
Signal an error when trying to visit an inexistent file.
-rw-r--r--lisp/view.el3
1 files changed, 3 insertions, 0 deletions
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.
242 242
243This command runs the normal hook `view-mode-hook'." 243This command runs the normal hook `view-mode-hook'."
244 (interactive "fView file: ") 244 (interactive "fView file: ")
245 (unless (file-exists-p file) (error "%s does not exist" file))
245 (let ((had-a-buf (get-file-buffer file))) 246 (let ((had-a-buf (get-file-buffer file)))
246 (view-buffer (find-file-noselect file) 247 (view-buffer (find-file-noselect file)
247 (and (not had-a-buf) 'kill-buffer)))) 248 (and (not had-a-buf) 'kill-buffer))))
@@ -258,6 +259,7 @@ For list of all View commands, type H or h while viewing.
258 259
259This command runs the normal hook `view-mode-hook'." 260This command runs the normal hook `view-mode-hook'."
260 (interactive "fIn other window view file: ") 261 (interactive "fIn other window view file: ")
262 (unless (file-exists-p file) (error "%s does not exist" file))
261 (let ((had-a-buf (get-file-buffer file))) 263 (let ((had-a-buf (get-file-buffer file)))
262 (view-buffer-other-window (find-file-noselect file) nil 264 (view-buffer-other-window (find-file-noselect file) nil
263 (and (not had-a-buf) 'kill-buffer)))) 265 (and (not had-a-buf) 'kill-buffer))))
@@ -274,6 +276,7 @@ For list of all View commands, type H or h while viewing.
274 276
275This command runs the normal hook `view-mode-hook'." 277This command runs the normal hook `view-mode-hook'."
276 (interactive "fIn other frame view file: ") 278 (interactive "fIn other frame view file: ")
279 (unless (file-exists-p file) (error "%s does not exist" file))
277 (let ((had-a-buf (get-file-buffer file))) 280 (let ((had-a-buf (get-file-buffer file)))
278 (view-buffer-other-frame (find-file-noselect file) nil 281 (view-buffer-other-frame (find-file-noselect file) nil
279 (and (not had-a-buf) 'kill-buffer)))) 282 (and (not had-a-buf) 'kill-buffer))))