Function: view-buffer-other-window
view-buffer-other-window is an autoloaded, interactive and
byte-compiled function defined in view.el.gz.
Signature
(view-buffer-other-window BUFFER &optional NOT-RETURN EXIT-ACTION)
Documentation
View BUFFER in View mode in another window.
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.
Optional argument NOT-RETURN is ignored.
Optional argument EXIT-ACTION is either nil or a function with buffer as
argument. This function is called when finished viewing buffer. Use
this argument instead of explicitly setting view-exit-action.
This function does not enable View mode if the buffer's major mode
has a special mode-class, because such modes usually have their
own View-like bindings.
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-buffer-other-window (buffer &optional _not-return exit-action)
"View BUFFER in View mode in another window.
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'.
Optional argument NOT-RETURN is ignored.
Optional argument EXIT-ACTION is either nil or a function with buffer as
argument. This function is called when finished viewing buffer. Use
this argument instead of explicitly setting `view-exit-action'.
This function does not enable View mode if the buffer's major mode
has a `special' mode-class, because such modes usually have their
own View-like bindings.
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 "bIn other window view buffer:\nP")
(let ((pop-up-windows t))
(pop-to-buffer buffer t))
(if (eq (get major-mode 'mode-class) 'special)
(message "Not using View mode because the major mode is special")
(view-mode-enter nil exit-action)))