Variable: switch-to-buffer-obey-display-actions

switch-to-buffer-obey-display-actions is a customizable variable defined in window.el.gz.

Value

nil

Documentation

If non-nil, switch-to-buffer runs pop-to-buffer-same-window instead.

This means that when switching the buffer it respects display actions specified by display-buffer-overriding-action, display-buffer-alist and other display related variables. So switch-to-buffer will display the buffer in the window specified by the rules from these variables.

This variable was added, or its default value changed, in Emacs 27.1.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defcustom switch-to-buffer-obey-display-actions nil
  "If non-nil, `switch-to-buffer' runs `pop-to-buffer-same-window' instead.
This means that when switching the buffer it respects display actions
specified by `display-buffer-overriding-action', `display-buffer-alist'
and other display related variables.  So `switch-to-buffer' will display
the buffer in the window specified by the rules from these variables."
  :type 'boolean
  :group 'windows
  :version "27.1")