summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2019-06-12 11:02:02 +0200
committerMartin Rudalics <rudalics@gmx.at>2019-06-12 11:02:02 +0200
commiteca2677b1db94a126b6d2871526a1d6fce98353d (patch)
tree73a3d1bd34cb569dbf91372eb58c655d192398d2 /lisp
parent7be50cda56ae0d2a31b8e2ae918409feeddaf6ca (diff)
downloademacs-eca2677b1db94a126b6d2871526a1d6fce98353d.tar.gz
Fix description of 'display-buffer-in-previous-window' again (Bug#36161)
* lisp/window.el (display-buffer-in-previous-window): Make doc-string more explicit (Bug#36161). * doc/lispref/windows.texi (Buffer Display Action Functions): Make description of 'display-buffer-in-previous-window' more explicit. (Buffer Display Action Alists): Mention 'display-buffer-in-previous-window' in description of 'reusable-frames' entry.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/window.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/window.el b/lisp/window.el
index c2d5b02be05..de110111b5a 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -7457,10 +7457,13 @@ selected frame."
(defun display-buffer-in-previous-window (buffer alist)
"Display BUFFER in a window previously showing it.
If ALIST has a non-nil `inhibit-same-window' entry, the selected
-window is not eligible for reuse.
+window is not usable. A dedicated window is usable only if it
+already shows BUFFER. If ALIST contains a `previous-window'
+entry, the window specified by that entry is usable even if it
+never showed BUFFER before.
If ALIST contains a `reusable-frames' entry, its value determines
-which frames to search for a reusable window:
+which frames to search for a usable window:
nil -- the selected frame (actually the last non-minibuffer frame)
A frame -- just that frame
`visible' -- all visible frames
@@ -7472,12 +7475,17 @@ selected frame if `display-buffer-reuse-frames' and
`pop-up-frames' are both nil; search all frames on the current
terminal if either of those variables is non-nil.
-If ALIST has a `previous-window' entry, the window specified by
-that entry may override any other window found by the methods
-above, even if that window never showed BUFFER before.
+If more than one window is usable according to these rules,
+apply the following order of preference:
+
+- Use the window specified by any 'previous-window' ALIST entry,
+ provided it is not the selected window.
+
+- Use a window that showed BUFFER before, provided it is not the
+ selected window.
-Avoid using the selected window if another eligible window has
-shown BUFFER before."
+- Use the selected window if it is either specified by a
+ 'previous-window' ALIST entry or showed BUFFER before."
(let* ((alist-entry (assq 'reusable-frames alist))
(inhibit-same-window
(cdr (assq 'inhibit-same-window alist)))