Function: other-window-prefix

other-window-prefix is an interactive and byte-compiled function defined in window.el.gz.

Signature

(other-window-prefix)

Documentation

Display the buffer of the next command in a new window.

The next buffer is the buffer displayed by the next command invoked immediately after this command (ignoring reading from the minibuffer). Creates a new window before displaying the buffer. When switch-to-buffer-obey-display-actions is non-nil, switch-to-buffer commands are also supported.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun other-window-prefix ()
  "Display the buffer of the next command in a new window.
The next buffer is the buffer displayed by the next command invoked
immediately after this command (ignoring reading from the minibuffer).
Creates a new window before displaying the buffer.
When `switch-to-buffer-obey-display-actions' is non-nil,
`switch-to-buffer' commands are also supported."
  (interactive)
  (display-buffer-override-next-command
   (lambda (buffer alist)
     (let ((alist (append '((inhibit-same-window . t)) alist))
           window type)
       (if (setq window (display-buffer-pop-up-window buffer alist))
           (setq type 'window)
         (setq window (display-buffer-use-some-window buffer alist)
               type 'reuse))
       (cons window type)))
   nil "[other-window]")
  (message "Display next command buffer in a new window..."))