Function: view-file-other-window
view-file-other-window is an autoloaded, interactive and byte-compiled
function defined in view.el.gz.
Signature
(view-file-other-window FILE)
Documentation
View FILE in View mode in another window.
When done, return that window to its previous buffer, and kill the buffer visiting FILE if unmodified and if it wasn't visited before.
Emacs commands editing the buffer contents are not available; instead, a special set of commands (mostly letters and punctuation) are defined for moving around in the buffer. Space scrolls forward, Delete scrolls backward. For a list of all View commands, type H or h while viewing.
This command runs the normal hook view-mode-hook.
If this command needs to split the current window, it by default obeys
the user options split-height-threshold and split-width-threshold,
when it decides whether to split the window horizontally or vertically.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/view.el.gz
;;;###autoload
(defun view-file-other-window (file)
"View FILE in View mode in another window.
When done, return that window to its previous buffer, and kill the
buffer visiting FILE if unmodified and if it wasn't visited before.
Emacs commands editing the buffer contents are not available; instead,
a special set of commands (mostly letters and punctuation)
are defined for moving around in the buffer.
Space scrolls forward, Delete scrolls backward.
For a list of all View commands, type H or h while viewing.
This command runs the normal hook `view-mode-hook'.
If this command needs to split the current window, it by default obeys
the user options `split-height-threshold' and `split-width-threshold',
when it decides whether to split the window horizontally or vertically."
(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))
(buf-to-view (find-file-noselect file)))
(view-buffer-other-window buf-to-view nil
(and (not had-a-buf)
'kill-buffer-if-not-modified))))