aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sainty2026-01-01 23:52:09 +1300
committerPhil Sainty2026-01-03 15:00:31 +1300
commitbe9371cde31fd2cc58f6469ac8cbaeb3cf31ebee (patch)
treec89ace81dcef52dab4735c469c6ffba4e6c4614a
parentbb43055ef08049fa3a1694b7769adbade762c17d (diff)
downloademacs-be9371cde31fd2cc58f6469ac8cbaeb3cf31ebee.tar.gz
emacs-be9371cde31fd2cc58f6469ac8cbaeb3cf31ebee.zip
Document more display actions in `display-buffer' (bug#80092)
* lisp/window.el (display-buffer): Add docs for several missing actions: - display-buffer-in-atom-window - display-buffer-in-direction - display-buffer-in-side-window - display-buffer-reuse-mode-window - display-buffer-use-some-frame Re-arrange the actions into a less-arbitrary sequence. Re-word some descriptions to use a more consistent phrasing. Re-wrap some lines (based on the longest pre-existing line), to reduce the line count. Un-link the `pop-up-frames' symbol in the alist entry listing. (display-buffer--action-function-custom-type): Add missing actions, and re-order as above. (display-buffer-reuse-mode-window): Tweak the docstring for better consistency with other display actions.
-rw-r--r--lisp/window.el57
1 files changed, 34 insertions, 23 deletions
diff --git a/lisp/window.el b/lisp/window.el
index df404083b32..3526873c8d9 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7987,20 +7987,25 @@ See the info node `(elisp)Dedicated Windows' for more details."
7987(defconst display-buffer--action-function-custom-type 7987(defconst display-buffer--action-function-custom-type
7988 '(choice :tag "Function" 7988 '(choice :tag "Function"
7989 (const :tag "--" ignore) ; default for insertion 7989 (const :tag "--" ignore) ; default for insertion
7990 (const display-buffer-same-window)
7990 (const display-buffer-reuse-window) 7991 (const display-buffer-reuse-window)
7992 (const display-buffer-in-previous-window)
7993 (const display-buffer-reuse-mode-window)
7994 (const display-buffer-use-some-window)
7995 (const display-buffer-use-least-recent-window)
7991 (const display-buffer-pop-up-window) 7996 (const display-buffer-pop-up-window)
7992 (const display-buffer-same-window)
7993 (const display-buffer-pop-up-frame) 7997 (const display-buffer-pop-up-frame)
7994 (const display-buffer-full-frame) 7998 (const display-buffer-full-frame)
7999 (const display-buffer-use-some-frame)
7995 (const display-buffer-in-child-frame) 8000 (const display-buffer-in-child-frame)
8001 (const display-buffer-in-side-window)
8002 (const display-buffer-in-atom-window)
7996 (const display-buffer-below-selected) 8003 (const display-buffer-below-selected)
7997 (const display-buffer-at-bottom) 8004 (const display-buffer-at-bottom)
7998 (const display-buffer-in-previous-window) 8005 (const display-buffer-in-direction)
7999 (const display-buffer-use-least-recent-window)
8000 (const display-buffer-use-some-window)
8001 (const display-buffer-use-some-frame)
8002 (const display-buffer-in-tab) 8006 (const display-buffer-in-tab)
8003 (const display-buffer-in-new-tab) 8007 (const display-buffer-in-new-tab)
8008 (const display-buffer-no-window)
8004 (function :tag "Other function")) 8009 (function :tag "Other function"))
8005 "Custom type for `display-buffer' action functions.") 8010 "Custom type for `display-buffer' action functions.")
8006 8011
@@ -8133,22 +8138,26 @@ To change which window is used, set `display-buffer-alist'
8133to an expression containing one of these \"action\" functions: 8138to an expression containing one of these \"action\" functions:
8134 8139
8135 `display-buffer-same-window' -- Use the selected window. 8140 `display-buffer-same-window' -- Use the selected window.
8136 `display-buffer-reuse-window' -- Use a window already showing 8141 `display-buffer-reuse-window' -- Use a window already showing the buffer.
8137 the buffer. 8142 `display-buffer-in-previous-window' -- Use a window that has previously
8138 `display-buffer-in-previous-window' -- Use a window that did 8143 displayed the buffer.
8139 show the buffer before. 8144 `display-buffer-reuse-mode-window' -- Use a window currently showing a
8145 buffer with the required major mode.
8140 `display-buffer-use-some-window' -- Use some existing window. 8146 `display-buffer-use-some-window' -- Use some existing window.
8141 `display-buffer-use-least-recent-window' -- Try to avoid reusing 8147 `display-buffer-use-least-recent-window' -- Try to avoid reusing windows
8142 windows that have recently been switched to. 8148 that have recently been switched to.
8143 `display-buffer-pop-up-window' -- Pop up a new window. 8149 `display-buffer-pop-up-window' -- Pop up a new window.
8150 `display-buffer-pop-up-frame' -- Use a new frame.
8144 `display-buffer-full-frame' -- Delete other windows and use the full frame. 8151 `display-buffer-full-frame' -- Delete other windows and use the full frame.
8145 `display-buffer-below-selected' -- Use or pop up a window below 8152 `display-buffer-use-some-frame' -- Use a frame meeting a predicate.
8146 the selected one. 8153 `display-buffer-in-child-frame' -- Use a child frame of the selected frame.
8147 `display-buffer-at-bottom' -- Use or pop up a window at the 8154 `display-buffer-in-side-window' -- Use a side window of the selected frame.
8148 bottom of the selected frame. 8155 `display-buffer-in-atom-window' -- Use an atomic window.
8149 `display-buffer-pop-up-frame' -- Show the buffer on a new frame. 8156 `display-buffer-below-selected' -- Use or pop up a window below the
8150 `display-buffer-in-child-frame' -- Show the buffer in a 8157 selected one.
8151 child frame. 8158 `display-buffer-at-bottom' -- Use or pop up a window at the bottom of the
8159 selected frame.
8160 `display-buffer-in-direction' -- Use a window in a specified direction.
8152 `display-buffer-in-tab' -- Use an appropriate existing tab or a new tab. 8161 `display-buffer-in-tab' -- Use an appropriate existing tab or a new tab.
8153 `display-buffer-in-new-tab' -- Use a new tab. 8162 `display-buffer-in-new-tab' -- Use a new tab.
8154 `display-buffer-no-window' -- Do not display the buffer and 8163 `display-buffer-no-window' -- Do not display the buffer and
@@ -8212,7 +8221,7 @@ Action alist entries are:
8212 Possible values are nil (the selected frame), t (any live 8221 Possible values are nil (the selected frame), t (any live
8213 frame), visible (any visible frame), 0 (any visible or 8222 frame), visible (any visible frame), 0 (any visible or
8214 iconified frame) or an existing live frame. 8223 iconified frame) or an existing live frame.
8215 `pop-up-frames' -- Same effect as the eponymous variable. 8224 \\+`pop-up-frames' -- Same effect as the eponymous variable.
8216 Takes precedence over the variable. 8225 Takes precedence over the variable.
8217 `pop-up-frame-parameters' -- The value specifies an alist of 8226 `pop-up-frame-parameters' -- The value specifies an alist of
8218 frame parameters to give a new frame, if one is created. 8227 frame parameters to give a new frame, if one is created.
@@ -8311,9 +8320,9 @@ Action alist entries are:
8311 selected regardless of which windows were selected afterwards within 8320 selected regardless of which windows were selected afterwards within
8312 this command. 8321 this command.
8313 `category' -- If the caller of `display-buffer' passes an alist entry 8322 `category' -- If the caller of `display-buffer' passes an alist entry
8314 `(category . symbol)' in its action argument, then you can match 8323 `(category . symbol)' in its action argument, then you can match
8315 the displayed buffer by using the same category in the condition 8324 the displayed buffer by using the same category in the condition
8316 part of `display-buffer-alist' entries. 8325 part of `display-buffer-alist' entries.
8317 ‘tab-name’ -- If non-nil, specifies the name of the tab in which to 8326 ‘tab-name’ -- If non-nil, specifies the name of the tab in which to
8318 display the buffer; see `display-buffer-in-new-tab'. 8327 display the buffer; see `display-buffer-in-new-tab'.
8319 \\+‘tab-group’ -- If non-nil, specifies the tab group to use when creating 8328 \\+‘tab-group’ -- If non-nil, specifies the tab group to use when creating
@@ -8569,7 +8578,9 @@ indirectly called by the latter."
8569 (window--maybe-raise-frame (window-frame window))))))) 8578 (window--maybe-raise-frame (window-frame window)))))))
8570 8579
8571(defun display-buffer-reuse-mode-window (buffer alist) 8580(defun display-buffer-reuse-mode-window (buffer alist)
8572 "Return a window based on the mode of the buffer it displays. 8581 "Display BUFFER in a window with a buffer of the required major mode.
8582
8583Return a window based on the major mode of the buffer it displays.
8573Display BUFFER in the returned window. Return nil if no usable 8584Display BUFFER in the returned window. Return nil if no usable
8574window is found. 8585window is found.
8575 8586