:value-type (sexp :tag "Value")))
"Custom type for `display-buffer' actions.")
+(defvar display-buffer-overriding-action '(nil . nil)
+ "Overriding action to perform to display a buffer.
+It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
+function or a list of functions. Each function should accept 2
+arguments: a buffer to display and an alist similar to ALIST.
+See `display-buffer' for details.")
+(put 'display-buffer-overriding-action 'risky-local-variable t)
+
(defcustom display-buffer-alist nil
"Alist of conditional actions for `display-buffer'.
This is a list of elements (CONDITION . ACTION), where:
:version "24.1"
:group 'windows)
-(defcustom display-buffer-default-action
- '((display-buffer--maybe-same-window
- display-buffer-reuse-window
- display-buffer--special
- display-buffer--maybe-pop-up-frame-or-window
- display-buffer-use-some-window
- ;; If all else fails, pop up a new frame.
- display-buffer-pop-up-frame))
- "List of default actions for `display-buffer'.
+(defcustom display-buffer-base-action '(nil . nil)
+ "User-specified default action for `display-buffer'.
It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
function or a list of functions. Each function should accept 2
arguments: a buffer to display and an alist similar to ALIST.
:version "24.1"
:group 'windows)
-(defcustom display-buffer-overriding-action '(nil . nil)
- "Overriding action to perform to display a buffer.
-It should be a cons cell (FUNCTION . ALIST), where FUNCTION is a
-function or a list of functions. Each function should accept 2
-arguments: a buffer to display and an alist similar to ALIST.
-See `display-buffer' for details."
- :type display-buffer--action-custom-type
- :risky t
- :version "24.1"
- :group 'windows)
+(defconst display-buffer-fallback-action
+ '((display-buffer--maybe-same-window
+ display-buffer-reuse-window
+ display-buffer--special
+ display-buffer--maybe-pop-up-frame-or-window
+ display-buffer-use-some-window
+ ;; If all else fails, pop up a new frame.
+ display-buffer-pop-up-frame))
+ "Default fallback action for `display-buffer'.
+This is the action used by `display-buffer' if no other actions
+specified, e.g. by the user options `display-buffer-alist' or
+`display-buffer-base-action'. See `display-buffer'.")
+(put 'display-buffer-fallback-action 'risky-local-variable t)
(defun display-buffer-assq-regexp (buffer-name alist)
"Retrieve ALIST entry corresponding to BUFFER-NAME."
alist. It should either display the buffer and return the
window, or return nil if unable to display the buffer.
-`display-buffer' builds a function list and an alist from
-`display-buffer-overriding-action', `display-buffer-alist',
-ACTION, and `display-buffer-default-action' (in that order).
-Then it calls each function in the combined function list in
-turn, passing the buffer as the first argument and the combined
-alist as the second argument, until a function returns non-nil.
+The `display-buffer' function builds a function list and an alist
+from `display-buffer-overriding-action', `display-buffer-alist',
+the ACTION argument, `display-buffer-base-action', and
+`display-buffer-fallback-action' (in that order). Then it calls
+each function in the combined function list in turn, passing the
+buffer as the first argument and the combined alist as the second
+argument, until one of the functions returns non-nil.
Available action functions include:
`display-buffer-same-window'
;; Construct action function list and action alist.
(actions (list display-buffer-overriding-action
user-action action extra-action
- display-buffer-default-action))
+ display-buffer-base-action
+ display-buffer-fallback-action))
(functions (apply 'append
(mapcar (lambda (x)
(setq x (car x))