aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-08-03 12:15:03 +0300
committerEli Zaretskii2019-08-03 12:15:03 +0300
commit49a5b573b25b70b3efd288efab0e27af1191d8c7 (patch)
tree73ed862a718b57d49418075e436f699021ed6722
parente56e85d227b9c14b02e9c938efe994176a015db2 (diff)
downloademacs-49a5b573b25b70b3efd288efab0e27af1191d8c7.tar.gz
emacs-49a5b573b25b70b3efd288efab0e27af1191d8c7.zip
Improve documentation of 'display-buffer-*' functions
* lisp/window.el (display-buffer-in-atom-window) (display-buffer-in-side-window, display-buffer-same-window) (display-buffer--maybe-same-window) (display-buffer-reuse-window) (display-buffer-reuse-mode-window) (display-buffer-pop-up-frame, display-buffer-pop-up-window) (display-buffer--maybe-pop-up-frame-or-window) (display-buffer--maybe-pop-up-frame) (display-buffer-in-child-frame, display-buffer-in-direction) (display-buffer-below-selected, display-buffer-at-bottom) (display-buffer-in-previous-window) (display-buffer-use-some-window, display-buffer-no-window): More details about the ALIST argument in the doc string. (Bug#19461)
-rw-r--r--lisp/window.el92
1 files changed, 82 insertions, 10 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 8b12c4381f4..70e2bba7499 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -666,8 +666,9 @@ new window to that atomic window. Operations like `split-window'
666or `delete-window', when applied to a constituent of an atomic 666or `delete-window', when applied to a constituent of an atomic
667window, are applied atomically to the root of that atomic window. 667window, are applied atomically to the root of that atomic window.
668 668
669ALIST is an association list of symbols and values. The 669ALIST is an association list of action symbols and values.
670following symbols can be used. 670See Info node `(elisp) Buffer Display Action Alists' for
671details of such alists. The following symbols can be used:
671 672
672`window' specifies the existing window the new window shall be 673`window' specifies the existing window the new window shall be
673 combined with. Use `window-atom-root' to make the new window a 674 combined with. Use `window-atom-root' to make the new window a
@@ -1000,8 +1001,10 @@ and may be called only if no window on SIDE exists yet."
1000 1001
1001(defun display-buffer-in-side-window (buffer alist) 1002(defun display-buffer-in-side-window (buffer alist)
1002 "Display BUFFER in a side window of the selected frame. 1003 "Display BUFFER in a side window of the selected frame.
1003ALIST is an association list of symbols and values. The 1004ALIST is an association list of action symbols and values.
1004following special symbols can be used in ALIST. 1005See Info node `(elisp) Buffer Display Action Alists' for
1006details of such alists.
1007The following special symbols can be used in ALIST:
1005 1008
1006 `side' denotes the side of the frame where the new window shall 1009 `side' denotes the side of the frame where the new window shall
1007 be located. Valid values are `bottom', `right', `top' and 1010 be located. Valid values are `bottom', `right', `top' and
@@ -7285,6 +7288,10 @@ The default predicate is to use any frame other than the selected
7285frame. If successful, return the window used; otherwise return 7288frame. If successful, return the window used; otherwise return
7286nil. 7289nil.
7287 7290
7291ALIST is an association list of action symbols and values.
7292See Info node `(elisp) Buffer Display Action Alists' for
7293details of such alists.
7294
7288If ALIST has a non-nil `inhibit-switch-frame' entry, avoid 7295If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
7289raising the frame. 7296raising the frame.
7290 7297
@@ -7314,10 +7321,15 @@ that allows the selected frame)."
7314 7321
7315(defun display-buffer-same-window (buffer alist) 7322(defun display-buffer-same-window (buffer alist)
7316 "Display BUFFER in the selected window. 7323 "Display BUFFER in the selected window.
7317This fails if ALIST has an `inhibit-same-window' element whose 7324
7318value is non-nil, or if the selected window is a minibuffer 7325ALIST is an association list of action symbols and values.
7319window or is dedicated to another buffer; in that case, return nil. 7326See Info node `(elisp) Buffer Display Action Alists' for
7320Otherwise, return the selected window." 7327details of such alists.
7328
7329This function fails if ALIST has an `inhibit-same-window'
7330element whose value is non-nil, or if the selected window is a
7331minibuffer window or is dedicated to another buffer; in that case,
7332return nil. Otherwise, return the selected window."
7321 (unless (or (cdr (assq 'inhibit-same-window alist)) 7333 (unless (or (cdr (assq 'inhibit-same-window alist))
7322 (window-minibuffer-p) 7334 (window-minibuffer-p)
7323 (window-dedicated-p)) 7335 (window-dedicated-p))
@@ -7325,6 +7337,11 @@ Otherwise, return the selected window."
7325 7337
7326(defun display-buffer--maybe-same-window (buffer alist) 7338(defun display-buffer--maybe-same-window (buffer alist)
7327 "Conditionally display BUFFER in the selected window. 7339 "Conditionally display BUFFER in the selected window.
7340
7341ALIST is an association list of action symbols and values.
7342See Info node `(elisp) Buffer Display Action Alists' for
7343details of such alists.
7344
7328If `same-window-p' returns non-nil for BUFFER's name, call 7345If `same-window-p' returns non-nil for BUFFER's name, call
7329`display-buffer-same-window' and return its value. Otherwise, 7346`display-buffer-same-window' and return its value. Otherwise,
7330return nil." 7347return nil."
@@ -7336,6 +7353,10 @@ return nil."
7336Preferably use a window on the selected frame if such a window 7353Preferably use a window on the selected frame if such a window
7337exists. Return nil if no usable window is found. 7354exists. Return nil if no usable window is found.
7338 7355
7356ALIST is an association list of action symbols and values.
7357See Info node `(elisp) Buffer Display Action Alists' for
7358details of such alists.
7359
7339If ALIST has a non-nil 'inhibit-same-window' entry, the selected 7360If ALIST has a non-nil 'inhibit-same-window' entry, the selected
7340window is not eligible for reuse. 7361window is not eligible for reuse.
7341 7362
@@ -7391,6 +7412,10 @@ that frame."
7391Display BUFFER in the returned window. Return nil if no usable 7412Display BUFFER in the returned window. Return nil if no usable
7392window is found. 7413window is found.
7393 7414
7415ALIST is an association list of action symbols and values.
7416See Info node `(elisp) Buffer Display Action Alists' for
7417details of such alists.
7418
7394If ALIST contains a `mode' entry, its value is a major mode (a 7419If ALIST contains a `mode' entry, its value is a major mode (a
7395symbol) or a list of modes. A window is a candidate if it 7420symbol) or a list of modes. A window is a candidate if it
7396displays a buffer that derives from one of the given modes. When 7421displays a buffer that derives from one of the given modes. When
@@ -7470,6 +7495,10 @@ See `display-buffer' for the format of display actions."
7470This works by calling `pop-up-frame-function'. If successful, 7495This works by calling `pop-up-frame-function'. If successful,
7471return the window used; otherwise return nil. 7496return the window used; otherwise return nil.
7472 7497
7498ALIST is an association list of action symbols and values.
7499See Info node `(elisp) Buffer Display Action Alists' for
7500details of such alists.
7501
7473If ALIST has a non-nil `inhibit-switch-frame' entry, avoid 7502If ALIST has a non-nil `inhibit-switch-frame' entry, avoid
7474raising the new frame. 7503raising the new frame.
7475 7504
@@ -7496,6 +7525,10 @@ The new window is created on the selected frame, or in
7496`last-nonminibuffer-frame' if no windows can be created there. 7525`last-nonminibuffer-frame' if no windows can be created there.
7497If successful, return the new window; otherwise return nil. 7526If successful, return the new window; otherwise return nil.
7498 7527
7528ALIST is an association list of action symbols and values.
7529See Info node `(elisp) Buffer Display Action Alists' for
7530details of such alists.
7531
7499If ALIST has a non-nil `inhibit-switch-frame' entry, then in the 7532If ALIST has a non-nil `inhibit-switch-frame' entry, then in the
7500event that the new window is created on another frame, avoid 7533event that the new window is created on another frame, avoid
7501raising the frame." 7534raising the frame."
@@ -7524,6 +7557,10 @@ raising the frame."
7524If `pop-up-frames' is non-nil (and not `graphic-only' on a 7557If `pop-up-frames' is non-nil (and not `graphic-only' on a
7525text-only terminal), try with `display-buffer-pop-up-frame'. 7558text-only terminal), try with `display-buffer-pop-up-frame'.
7526 7559
7560ALIST is an association list of action symbols and values.
7561See Info node `(elisp) Buffer Display Action Alists' for
7562details of such alists.
7563
7527If that cannot be done, and `pop-up-windows' is non-nil, try 7564If that cannot be done, and `pop-up-windows' is non-nil, try
7528again with `display-buffer-pop-up-window'." 7565again with `display-buffer-pop-up-window'."
7529 (or (display-buffer--maybe-pop-up-frame buffer alist) 7566 (or (display-buffer--maybe-pop-up-frame buffer alist)
@@ -7532,7 +7569,11 @@ again with `display-buffer-pop-up-window'."
7532(defun display-buffer--maybe-pop-up-frame (buffer alist) 7569(defun display-buffer--maybe-pop-up-frame (buffer alist)
7533 "Try displaying BUFFER based on `pop-up-frames'. 7570 "Try displaying BUFFER based on `pop-up-frames'.
7534If `pop-up-frames' is non-nil (and not `graphic-only' on a 7571If `pop-up-frames' is non-nil (and not `graphic-only' on a
7535text-only terminal), try with `display-buffer-pop-up-frame'." 7572text-only terminal), try with `display-buffer-pop-up-frame'.
7573
7574ALIST is an association list of action symbols and values.
7575See Info node `(elisp) Buffer Display Action Alists' for
7576details of such alists."
7536 (and (if (eq pop-up-frames 'graphic-only) 7577 (and (if (eq pop-up-frames 'graphic-only)
7537 (display-graphic-p) 7578 (display-graphic-p)
7538 pop-up-frames) 7579 pop-up-frames)
@@ -7550,6 +7591,10 @@ By default, this either reuses a child frame of the selected
7550frame or makes a new child frame of the selected frame. If 7591frame or makes a new child frame of the selected frame. If
7551successful, return the window used; otherwise return nil. 7592successful, return the window used; otherwise return nil.
7552 7593
7594ALIST is an association list of action symbols and values.
7595See Info node `(elisp) Buffer Display Action Alists' for
7596details of such alists.
7597
7553If ALIST has a non-nil 'child-frame-parameters' entry, the 7598If ALIST has a non-nil 'child-frame-parameters' entry, the
7554corresponding value is an alist of frame parameters to give the 7599corresponding value is an alist of frame parameters to give the
7555new frame. A 'parent-frame' parameter specifying the selected 7600new frame. A 'parent-frame' parameter specifying the selected
@@ -7653,6 +7698,11 @@ ALIST is a buffer display alist."
7653 7698
7654(defun display-buffer-in-direction (buffer alist) 7699(defun display-buffer-in-direction (buffer alist)
7655 "Try to display BUFFER in a direction specified by ALIST. 7700 "Try to display BUFFER in a direction specified by ALIST.
7701
7702ALIST is an association list of action symbols and values.
7703See Info node `(elisp) Buffer Display Action Alists' for
7704details of such alists.
7705
7656ALIST has to contain a 'direction' entry whose value should be 7706ALIST has to contain a 'direction' entry whose value should be
7657one of 'left', 'above' (or 'up'), 'right', and 'below' (or 7707one of 'left', 'above' (or 'up'), 'right', and 'below' (or
7658'down'). Other values are usually interpreted as 'below'. 7708'down'). Other values are usually interpreted as 'below'.
@@ -7741,6 +7791,10 @@ create a new window below the selected one and show BUFFER there.
7741If that attempt fails as well and there is a non-dedicated window 7791If that attempt fails as well and there is a non-dedicated window
7742below the selected one, use that window. 7792below the selected one, use that window.
7743 7793
7794ALIST is an association list of action symbols and values.
7795See Info node `(elisp) Buffer Display Action Alists' for
7796details of such alists.
7797
7744If ALIST contains a 'window-min-height' entry, this function 7798If ALIST contains a 'window-min-height' entry, this function
7745ensures that the window used is or can become at least as high as 7799ensures that the window used is or can become at least as high as
7746specified by that entry's value. Note that such an entry alone 7800specified by that entry's value. Note that such an entry alone
@@ -7795,7 +7849,11 @@ must also contain a 'window-height' entry with the same value."
7795This either reuses such a window provided it shows BUFFER 7849This either reuses such a window provided it shows BUFFER
7796already, splits a window at the bottom of the frame or the 7850already, splits a window at the bottom of the frame or the
7797frame's root window, or reuses some window at the bottom of the 7851frame's root window, or reuses some window at the bottom of the
7798selected frame." 7852selected frame.
7853
7854ALIST is an association list of action symbols and values.
7855See Info node `(elisp) Buffer Display Action Alists' for
7856details of such alists."
7799 (let (bottom-window bottom-window-shows-buffer window) 7857 (let (bottom-window bottom-window-shows-buffer window)
7800 (walk-window-tree 7858 (walk-window-tree
7801 (lambda (window) 7859 (lambda (window)
@@ -7819,6 +7877,11 @@ selected frame."
7819 7877
7820(defun display-buffer-in-previous-window (buffer alist) 7878(defun display-buffer-in-previous-window (buffer alist)
7821 "Display BUFFER in a window previously showing it. 7879 "Display BUFFER in a window previously showing it.
7880
7881ALIST is an association list of action symbols and values.
7882See Info node `(elisp) Buffer Display Action Alists' for
7883details of such alists.
7884
7822If ALIST has a non-nil `inhibit-same-window' entry, the selected 7885If ALIST has a non-nil `inhibit-same-window' entry, the selected
7823window is not usable. A dedicated window is usable only if it 7886window is not usable. A dedicated window is usable only if it
7824already shows BUFFER. If ALIST contains a `previous-window' 7887already shows BUFFER. If ALIST contains a `previous-window'
@@ -7890,6 +7953,10 @@ apply the following order of preference:
7890Search for a usable window, set that window to the buffer, and 7953Search for a usable window, set that window to the buffer, and
7891return the window. If no suitable window is found, return nil. 7954return the window. If no suitable window is found, return nil.
7892 7955
7956ALIST is an association list of action symbols and values.
7957See Info node `(elisp) Buffer Display Action Alists' for
7958details of such alists.
7959
7893If ALIST has a non-nil `inhibit-switch-frame' entry, then in the 7960If ALIST has a non-nil `inhibit-switch-frame' entry, then in the
7894event that a window in another frame is chosen, avoid raising 7961event that a window in another frame is chosen, avoid raising
7895that frame." 7962that frame."
@@ -7930,6 +7997,11 @@ that frame."
7930 7997
7931(defun display-buffer-no-window (_buffer alist) 7998(defun display-buffer-no-window (_buffer alist)
7932 "Display BUFFER in no window. 7999 "Display BUFFER in no window.
8000
8001ALIST is an association list of action symbols and values.
8002See Info node `(elisp) Buffer Display Action Alists' for
8003details of such alists.
8004
7933If ALIST has a non-nil `allow-no-window' entry, then don't display 8005If ALIST has a non-nil `allow-no-window' entry, then don't display
7934a window at all. This makes possible to override the default action 8006a window at all. This makes possible to override the default action
7935and avoid displaying the buffer. It is assumed that when the caller 8007and avoid displaying the buffer. It is assumed that when the caller