mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-24 19:03:29 +00:00
(view-file, view-file-other-window, view-file-other-frame):
Signal an error when trying to visit an inexistent file.
This commit is contained in:
parent
0bfb74a943
commit
981b7b0c72
@ -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))))
|
||||
|
Loading…
Reference in New Issue
Block a user