diff options
| author | Martin Rudalics | 2019-01-10 11:02:17 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2019-01-10 11:02:17 +0100 |
| commit | f646675cd1637948b2df2351a9666792ea8251ea (patch) | |
| tree | 8952c35ffd299c41799c854b135c96b3b2d87218 | |
| parent | a2e78046f6b52e0a433ae6e1b9e6e5015f415412 (diff) | |
| download | emacs-f646675cd1637948b2df2351a9666792ea8251ea.tar.gz emacs-f646675cd1637948b2df2351a9666792ea8251ea.zip | |
Handle dedicated status in 'window--display-buffer' (Bug#33870)
* lisp/window.el (display-buffer-record-window): Rewrite
doc-string.
(window--display-buffer): Remove fifth argument DEDICATED and
either directly use a 'dedicated' entry in ALIST or the value
of 'display-buffer-mark-dedicated' instead.
(display-buffer-in-atom-window, display-buffer-use-some-frame)
(display-buffer-pop-up-frame, display-buffer-pop-up-window)
(display-buffer-below-selected, display-buffer-at-bottom):
Adjust callers of 'window--display-buffer'.
(window--make-major-side-window)
(display-buffer-in-side-window): Handle dedicated status of
the chosen side window via a 'dedicated' alist entry and
adjust 'window--display-buffer' call.
(display-buffer-in-child-frame): Set up TYPE correctly for and
adjust 'window--display-buffer' call.
(display-buffer-in-previous-window): Handle dedicated status
of a previous window already showing BUFFER.
* doc/lispref/windows.texi (Buffer Display Action Alists): New
action alist entry 'dedicated'.
(Dedicated Windows): Mention new buffer display action alist
entry 'dedicated'.
* etc/NEWS: Mention new buffer display action alist entry
'dedicated'.
| -rw-r--r-- | doc/lispref/windows.texi | 10 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/window.el | 156 |
3 files changed, 108 insertions, 63 deletions
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 3940dd89246..a0853180fb4 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -2881,6 +2881,13 @@ Frames}) to avoid changing the width of other, unrelated windows. | |||
| 2881 | Also, this entry should be processed under only certain conditions | 2881 | Also, this entry should be processed under only certain conditions |
| 2882 | which are specified right below this list. | 2882 | which are specified right below this list. |
| 2883 | 2883 | ||
| 2884 | @vindex dedicated@r{, a buffer display action alist entry} | ||
| 2885 | @item dedicated | ||
| 2886 | If non-@code{nil}, such an entry tells @code{display-buffer} to mark | ||
| 2887 | any window it creates as dedicated to its buffer (@pxref{Dedicated | ||
| 2888 | Windows}). It does that by calling @code{set-window-dedicated-p} with | ||
| 2889 | the chosen window as first argument and the entry's value as second. | ||
| 2890 | |||
| 2884 | @vindex preserve-size@r{, a buffer display action alist entry} | 2891 | @vindex preserve-size@r{, a buffer display action alist entry} |
| 2885 | @item preserve-size | 2892 | @item preserve-size |
| 2886 | If non-@code{nil} such an entry tells Emacs to preserve the size of | 2893 | If non-@code{nil} such an entry tells Emacs to preserve the size of |
| @@ -3900,6 +3907,9 @@ display. Other functions do not treat @code{t} differently from any | |||
| 3900 | non-@code{nil} value. | 3907 | non-@code{nil} value. |
| 3901 | @end defun | 3908 | @end defun |
| 3902 | 3909 | ||
| 3910 | You can also tell @code{display-buffer} to mark a window it creates as | ||
| 3911 | dedicated to its buffer by providing a suitable @code{dedicated} | ||
| 3912 | action alist entry (@pxref{Buffer Display Action Alists}). | ||
| 3903 | 3913 | ||
| 3904 | @node Quitting Windows | 3914 | @node Quitting Windows |
| 3905 | @section Quitting Windows | 3915 | @section Quitting Windows |
| @@ -1288,6 +1288,11 @@ A buffer-local value of this hook is now run only if at least one | |||
| 1288 | window showing the buffer has changed its size. | 1288 | window showing the buffer has changed its size. |
| 1289 | 1289 | ||
| 1290 | +++ | 1290 | +++ |
| 1291 | ** New buffer display action alist entry 'dedicated'. | ||
| 1292 | Such an entry allows to specify the dedicated status of a window | ||
| 1293 | created by 'display-buffer'. | ||
| 1294 | |||
| 1295 | +++ | ||
| 1291 | ** New buffer display action alist entry 'window-min-height'. | 1296 | ** New buffer display action alist entry 'window-min-height'. |
| 1292 | Such an entry allows to specify a minimum height of the window used | 1297 | Such an entry allows to specify a minimum height of the window used |
| 1293 | for displaying a buffer. 'display-buffer-below-selected' is the only | 1298 | for displaying a buffer. 'display-buffer-below-selected' is the only |
diff --git a/lisp/window.el b/lisp/window.el index 37d82c060c6..751263c9259 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -700,8 +700,7 @@ failed." | |||
| 700 | (set-window-parameter window 'window-atom 'main)) | 700 | (set-window-parameter window 'window-atom 'main)) |
| 701 | (set-window-parameter new 'window-atom side) | 701 | (set-window-parameter new 'window-atom side) |
| 702 | ;; Display BUFFER in NEW and return NEW. | 702 | ;; Display BUFFER in NEW and return NEW. |
| 703 | (window--display-buffer | 703 | (window--display-buffer buffer new 'window alist)))) |
| 704 | buffer new 'window alist display-buffer-mark-dedicated)))) | ||
| 705 | 704 | ||
| 706 | (defun window--atom-check-1 (window) | 705 | (defun window--atom-check-1 (window) |
| 707 | "Subroutine of `window--atom-check'." | 706 | "Subroutine of `window--atom-check'." |
| @@ -958,7 +957,11 @@ and may be called only if no window on SIDE exists yet." | |||
| 958 | ;; window and not make a new parent window unless needed. | 957 | ;; window and not make a new parent window unless needed. |
| 959 | (window-combination-resize 'side) | 958 | (window-combination-resize 'side) |
| 960 | (window-combination-limit nil) | 959 | (window-combination-limit nil) |
| 961 | (window (split-window-no-error next-to nil on-side))) | 960 | (window (split-window-no-error next-to nil on-side)) |
| 961 | (alist (if (assq 'dedicated alist) | ||
| 962 | alist | ||
| 963 | (cons `(dedicated . ,(or display-buffer-mark-dedicated 'side)) | ||
| 964 | alist)))) | ||
| 962 | (when window | 965 | (when window |
| 963 | ;; Initialize `window-side' parameter of new window to SIDE and | 966 | ;; Initialize `window-side' parameter of new window to SIDE and |
| 964 | ;; make that parameter persistent. | 967 | ;; make that parameter persistent. |
| @@ -985,7 +988,7 @@ and may be called only if no window on SIDE exists yet." | |||
| 985 | (with-current-buffer buffer | 988 | (with-current-buffer buffer |
| 986 | (setq window--sides-shown t)) | 989 | (setq window--sides-shown t)) |
| 987 | ;; Install BUFFER in new window and return WINDOW. | 990 | ;; Install BUFFER in new window and return WINDOW. |
| 988 | (window--display-buffer buffer window 'window alist 'side)))) | 991 | (window--display-buffer buffer window 'window alist)))) |
| 989 | 992 | ||
| 990 | (defun display-buffer-in-side-window (buffer alist) | 993 | (defun display-buffer-in-side-window (buffer alist) |
| 991 | "Display BUFFER in a side window of the selected frame. | 994 | "Display BUFFER in a side window of the selected frame. |
| @@ -1019,10 +1022,7 @@ nor installs any other window parameters unless they have been | |||
| 1019 | explicitly provided via a `window-parameters' entry in ALIST." | 1022 | explicitly provided via a `window-parameters' entry in ALIST." |
| 1020 | (let* ((side (or (cdr (assq 'side alist)) 'bottom)) | 1023 | (let* ((side (or (cdr (assq 'side alist)) 'bottom)) |
| 1021 | (slot (or (cdr (assq 'slot alist)) 0)) | 1024 | (slot (or (cdr (assq 'slot alist)) 0)) |
| 1022 | (left-or-right (memq side '(left right))) | 1025 | (left-or-right (memq side '(left right)))) |
| 1023 | ;; Softly dedicate window to BUFFER unless | ||
| 1024 | ;; `display-buffer-mark-dedicated' already asks for it. | ||
| 1025 | (dedicated (or display-buffer-mark-dedicated 'side))) | ||
| 1026 | (cond | 1026 | (cond |
| 1027 | ((not (memq side '(top bottom left right))) | 1027 | ((not (memq side '(top bottom left right))) |
| 1028 | (error "Invalid side %s specified" side)) | 1028 | (error "Invalid side %s specified" side)) |
| @@ -1055,7 +1055,11 @@ explicitly provided via a `window-parameters' entry in ALIST." | |||
| 1055 | ((eq side 'bottom) 3)) | 1055 | ((eq side 'bottom) 3)) |
| 1056 | window-sides-slots)) | 1056 | window-sides-slots)) |
| 1057 | (window--sides-inhibit-check t) | 1057 | (window--sides-inhibit-check t) |
| 1058 | window this-window this-slot prev-window next-window | 1058 | (alist (if (assq 'dedicated alist) |
| 1059 | alist | ||
| 1060 | (cons `(dedicated . ,(or display-buffer-mark-dedicated 'side)) | ||
| 1061 | alist))) | ||
| 1062 | window this-window this-slot prev-window next-window | ||
| 1059 | best-window best-slot abs-slot) | 1063 | best-window best-slot abs-slot) |
| 1060 | 1064 | ||
| 1061 | (cond | 1065 | (cond |
| @@ -1113,8 +1117,7 @@ explicitly provided via a `window-parameters' entry in ALIST." | |||
| 1113 | ;; Reuse `this-window'. | 1117 | ;; Reuse `this-window'. |
| 1114 | (with-current-buffer buffer | 1118 | (with-current-buffer buffer |
| 1115 | (setq window--sides-shown t)) | 1119 | (setq window--sides-shown t)) |
| 1116 | (window--display-buffer | 1120 | (window--display-buffer buffer this-window 'reuse alist)) |
| 1117 | buffer this-window 'reuse alist dedicated)) | ||
| 1118 | (and (or (not max-slots) (< slots max-slots)) | 1121 | (and (or (not max-slots) (< slots max-slots)) |
| 1119 | (or (and next-window | 1122 | (or (and next-window |
| 1120 | ;; Make new window before `next-window'. | 1123 | ;; Make new window before `next-window'. |
| @@ -1131,8 +1134,7 @@ explicitly provided via a `window-parameters' entry in ALIST." | |||
| 1131 | (set-window-parameter window 'window-slot slot) | 1134 | (set-window-parameter window 'window-slot slot) |
| 1132 | (with-current-buffer buffer | 1135 | (with-current-buffer buffer |
| 1133 | (setq window--sides-shown t)) | 1136 | (setq window--sides-shown t)) |
| 1134 | (window--display-buffer | 1137 | (window--display-buffer buffer window 'window alist)) |
| 1135 | buffer window 'window alist dedicated)) | ||
| 1136 | (and best-window | 1138 | (and best-window |
| 1137 | ;; Reuse `best-window'. | 1139 | ;; Reuse `best-window'. |
| 1138 | (progn | 1140 | (progn |
| @@ -1141,7 +1143,7 @@ explicitly provided via a `window-parameters' entry in ALIST." | |||
| 1141 | (with-current-buffer buffer | 1143 | (with-current-buffer buffer |
| 1142 | (setq window--sides-shown t)) | 1144 | (setq window--sides-shown t)) |
| 1143 | (window--display-buffer | 1145 | (window--display-buffer |
| 1144 | buffer best-window 'reuse alist dedicated))))))))) | 1146 | buffer best-window 'reuse alist))))))))) |
| 1145 | 1147 | ||
| 1146 | (defun window-toggle-side-windows (&optional frame) | 1148 | (defun window-toggle-side-windows (&optional frame) |
| 1147 | "Toggle display of side windows on specified FRAME. | 1149 | "Toggle display of side windows on specified FRAME. |
| @@ -6073,23 +6075,26 @@ not resized by this function." | |||
| 6073 | 6075 | ||
| 6074 | (defun display-buffer-record-window (type window buffer) | 6076 | (defun display-buffer-record-window (type window buffer) |
| 6075 | "Record information for window used by `display-buffer'. | 6077 | "Record information for window used by `display-buffer'. |
| 6078 | WINDOW is the window used for or created by a buffer display | ||
| 6079 | action function. BUFFER is the buffer to display. Note that | ||
| 6080 | this function must be called before BUFFER is explicitly made | ||
| 6081 | WINDOW's buffer (although WINDOW may show BUFFER already). | ||
| 6082 | |||
| 6076 | TYPE specifies the type of the calling operation and must be one | 6083 | TYPE specifies the type of the calling operation and must be one |
| 6077 | of the symbols `reuse' (when WINDOW existed already and was | 6084 | of the symbols 'reuse' (meaning that WINDOW exists already and |
| 6078 | reused for displaying BUFFER), `window' (when WINDOW was created | 6085 | will be used for displaying BUFFER), 'window' (WINDOW was created |
| 6079 | on an already existing frame), or `frame' (when WINDOW was | 6086 | on an already existing frame) or 'frame' (WINDOW was created on a |
| 6080 | created on a new frame). WINDOW is the window used for or created | 6087 | new frame). |
| 6081 | by the `display-buffer' routines. BUFFER is the buffer that | 6088 | |
| 6082 | shall be displayed. | 6089 | This function installs or updates the 'quit-restore' parameter of |
| 6083 | 6090 | WINDOW. The 'quit-restore' parameter is a list of four elements: | |
| 6084 | This function installs or updates the quit-restore parameter of | 6091 | The first element is one of the symbols 'window', 'frame', 'same' |
| 6085 | WINDOW. The quit-restore parameter is a list of four elements: | 6092 | or 'other'. The second element is either one of the symbols |
| 6086 | The first element is one of the symbols `window', `frame', `same' or | 6093 | 'window' or 'frame' or a list whose elements are the buffer |
| 6087 | `other'. The second element is either one of the symbols `window' | 6094 | previously shown in the window, that buffer's window start and |
| 6088 | or `frame' or a list whose elements are the buffer previously | 6095 | window point, and the window's height. The third element is the |
| 6089 | shown in the window, that buffer's window start and window point, | 6096 | window selected at the time the parameter was created. The |
| 6090 | and the window's height. The third element is the window | 6097 | fourth element is BUFFER." |
| 6091 | selected at the time the parameter was created. The fourth | ||
| 6092 | element is BUFFER." | ||
| 6093 | (cond | 6098 | (cond |
| 6094 | ((eq type 'reuse) | 6099 | ((eq type 'reuse) |
| 6095 | (if (eq (window-buffer window) buffer) | 6100 | (if (eq (window-buffer window) buffer) |
| @@ -6748,20 +6753,51 @@ window is larger than WINDOW." | |||
| 6748 | (/ (- (window-total-height window) (window-total-height)) 2)) | 6753 | (/ (- (window-total-height window) (window-total-height)) 2)) |
| 6749 | (error nil)))))) | 6754 | (error nil)))))) |
| 6750 | 6755 | ||
| 6751 | (defun window--display-buffer (buffer window type &optional alist dedicated) | 6756 | (defun window--display-buffer (buffer window type &optional alist) |
| 6752 | "Display BUFFER in WINDOW. | 6757 | "Display BUFFER in WINDOW. |
| 6753 | TYPE must be one of the symbols `reuse', `window' or `frame' and | 6758 | WINDOW must be a live window chosen by a buffer display action |
| 6754 | is passed unaltered to `display-buffer-record-window'. ALIST is | 6759 | function for showing BUFFER. TYPE tells whether WINDOW existed |
| 6755 | the alist argument of `display-buffer'. Set `window-dedicated-p' | 6760 | already before that action function was called or is a new window |
| 6756 | to DEDICATED if non-nil. Return WINDOW if BUFFER and WINDOW are | 6761 | created by that function. ALIST is a buffer display action alist |
| 6757 | live." | 6762 | as compiled by `display-buffer'. |
| 6763 | |||
| 6764 | TYPE must be one of the following symbols: 'reuse' (which means | ||
| 6765 | WINDOW existed before the call of `display-buffer' and may | ||
| 6766 | already show BUFFER or not), 'window' (WINDOW was created on an | ||
| 6767 | existing frame) or 'frame' (WINDOW was created on a new frame). | ||
| 6768 | TYPE is passed unaltered to `display-buffer-record-window'. | ||
| 6769 | |||
| 6770 | Handle WINDOW's dedicated flag as follows: If WINDOW already | ||
| 6771 | shows BUFFER, leave it alone. Otherwise, if ALIST contains a | ||
| 6772 | 'dedicated' entry and WINDOW is either new or that entry's value | ||
| 6773 | equals 'side', set WINDOW's dedicated flag to the value of that | ||
| 6774 | entry. Otherwise, if WINDOW is new and the value of | ||
| 6775 | 'display-buffer-mark-dedicated' is non-nil, set WINDOW's | ||
| 6776 | dedicated flag to that value. In any other case, reset WINDOW's | ||
| 6777 | dedicated flag to nil. | ||
| 6778 | |||
| 6779 | Return WINDOW if BUFFER and WINDOW are live." | ||
| 6758 | (when (and (buffer-live-p buffer) (window-live-p window)) | 6780 | (when (and (buffer-live-p buffer) (window-live-p window)) |
| 6759 | (display-buffer-record-window type window buffer) | 6781 | (display-buffer-record-window type window buffer) |
| 6760 | (unless (eq buffer (window-buffer window)) | 6782 | (unless (eq buffer (window-buffer window)) |
| 6783 | ;; Unless WINDOW already shows BUFFER reset its dedicated flag. | ||
| 6761 | (set-window-dedicated-p window nil) | 6784 | (set-window-dedicated-p window nil) |
| 6762 | (set-window-buffer window buffer)) | 6785 | (set-window-buffer window buffer)) |
| 6763 | (when dedicated | 6786 | (let ((alist-dedicated (assq 'dedicated alist))) |
| 6764 | (set-window-dedicated-p window dedicated)) | 6787 | ;; Maybe dedicate WINDOW to BUFFER if asked for. |
| 6788 | (cond | ||
| 6789 | ;; Don't dedicate WINDOW if it is dedicated because it shows | ||
| 6790 | ;; BUFFER already or it is reused and is not a side window. | ||
| 6791 | ((or (window-dedicated-p window) | ||
| 6792 | (and (eq type 'reuse) (not (eq (cdr alist-dedicated) 'side))))) | ||
| 6793 | ;; Otherwise, if ALIST contains a 'dedicated' entry, use that | ||
| 6794 | ;; entry's value (which may be nil). | ||
| 6795 | (alist-dedicated | ||
| 6796 | (set-window-dedicated-p window (cdr alist-dedicated))) | ||
| 6797 | ;; Otherwise, if 'display-buffer-mark-dedicated' is non-nil, | ||
| 6798 | ;; use that. | ||
| 6799 | (display-buffer-mark-dedicated | ||
| 6800 | (set-window-dedicated-p window display-buffer-mark-dedicated)))) | ||
| 6765 | (when (memq type '(window frame)) | 6801 | (when (memq type '(window frame)) |
| 6766 | (set-window-prev-buffers window nil)) | 6802 | (set-window-prev-buffers window nil)) |
| 6767 | (let ((quit-restore (window-parameter window 'quit-restore)) | 6803 | (let ((quit-restore (window-parameter window 'quit-restore)) |
| @@ -7190,8 +7226,7 @@ that allows the selected frame)." | |||
| 7190 | frame nil (cdr (assq 'inhibit-same-window alist)))))) | 7226 | frame nil (cdr (assq 'inhibit-same-window alist)))))) |
| 7191 | (when window | 7227 | (when window |
| 7192 | (prog1 | 7228 | (prog1 |
| 7193 | (window--display-buffer | 7229 | (window--display-buffer buffer window 'reuse alist) |
| 7194 | buffer window 'reuse alist display-buffer-mark-dedicated) | ||
| 7195 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 7230 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 7196 | (window--maybe-raise-frame frame)))))) | 7231 | (window--maybe-raise-frame frame)))))) |
| 7197 | 7232 | ||
| @@ -7356,8 +7391,7 @@ new frame." | |||
| 7356 | (with-current-buffer buffer | 7391 | (with-current-buffer buffer |
| 7357 | (setq frame (funcall fun))) | 7392 | (setq frame (funcall fun))) |
| 7358 | (setq window (frame-selected-window frame))) | 7393 | (setq window (frame-selected-window frame))) |
| 7359 | (prog1 (window--display-buffer | 7394 | (prog1 (window--display-buffer buffer window 'frame alist) |
| 7360 | buffer window 'frame alist display-buffer-mark-dedicated) | ||
| 7361 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 7395 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 7362 | (window--maybe-raise-frame frame)))))) | 7396 | (window--maybe-raise-frame frame)))))) |
| 7363 | 7397 | ||
| @@ -7386,8 +7420,7 @@ raising the frame." | |||
| 7386 | (window--try-to-split-window | 7420 | (window--try-to-split-window |
| 7387 | (get-lru-window frame t) alist)))) | 7421 | (get-lru-window frame t) alist)))) |
| 7388 | 7422 | ||
| 7389 | (prog1 (window--display-buffer | 7423 | (prog1 (window--display-buffer buffer window 'window alist) |
| 7390 | buffer window 'window alist display-buffer-mark-dedicated) | ||
| 7391 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 7424 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 7392 | (window--maybe-raise-frame (window-frame window))))))) | 7425 | (window--maybe-raise-frame (window-frame window))))))) |
| 7393 | 7426 | ||
| @@ -7435,7 +7468,7 @@ be added to ALIST." | |||
| 7435 | (parent (or (assq 'parent-frame parameters) | 7468 | (parent (or (assq 'parent-frame parameters) |
| 7436 | (selected-frame))) | 7469 | (selected-frame))) |
| 7437 | (share (assq 'share-child-frame parameters)) | 7470 | (share (assq 'share-child-frame parameters)) |
| 7438 | share1 frame window) | 7471 | share1 frame window type) |
| 7439 | (with-current-buffer buffer | 7472 | (with-current-buffer buffer |
| 7440 | (when (frame-live-p parent) | 7473 | (when (frame-live-p parent) |
| 7441 | (catch 'frame | 7474 | (catch 'frame |
| @@ -7448,12 +7481,14 @@ be added to ALIST." | |||
| 7448 | (throw 'frame t)))))) | 7481 | (throw 'frame t)))))) |
| 7449 | 7482 | ||
| 7450 | (if frame | 7483 | (if frame |
| 7451 | (setq window (frame-selected-window frame)) | 7484 | (progn |
| 7485 | (setq window (frame-selected-window frame)) | ||
| 7486 | (setq type 'reuse)) | ||
| 7452 | (setq frame (make-frame parameters)) | 7487 | (setq frame (make-frame parameters)) |
| 7453 | (setq window (frame-selected-window frame)))) | 7488 | (setq window (frame-selected-window frame)) |
| 7489 | (setq type 'frame))) | ||
| 7454 | 7490 | ||
| 7455 | (prog1 (window--display-buffer | 7491 | (prog1 (window--display-buffer buffer window type alist) |
| 7456 | buffer window 'frame alist display-buffer-mark-dedicated) | ||
| 7457 | (unless (cdr (assq 'inhibit-switch-frame alist)) | 7492 | (unless (cdr (assq 'inhibit-switch-frame alist)) |
| 7458 | (window--maybe-raise-frame frame))))) | 7493 | (window--maybe-raise-frame frame))))) |
| 7459 | 7494 | ||
| @@ -7492,16 +7527,14 @@ must also contain a 'window-height' entry with the same value." | |||
| 7492 | split-width-threshold) | 7527 | split-width-threshold) |
| 7493 | (setq window (window--try-to-split-window | 7528 | (setq window (window--try-to-split-window |
| 7494 | (selected-window) alist))) | 7529 | (selected-window) alist))) |
| 7495 | (window--display-buffer | 7530 | (window--display-buffer buffer window 'window alist)) |
| 7496 | buffer window 'window alist display-buffer-mark-dedicated)) | ||
| 7497 | (and (setq window (window-in-direction 'below)) | 7531 | (and (setq window (window-in-direction 'below)) |
| 7498 | (not (window-dedicated-p window)) | 7532 | (not (window-dedicated-p window)) |
| 7499 | (or (not (numberp min-height)) | 7533 | (or (not (numberp min-height)) |
| 7500 | ;; A window that showed another buffer before cannot | 7534 | ;; A window that showed another buffer before cannot |
| 7501 | ;; be resized. | 7535 | ;; be resized. |
| 7502 | (>= (window-height window) min-height)) | 7536 | (>= (window-height window) min-height)) |
| 7503 | (window--display-buffer | 7537 | (window--display-buffer buffer window 'reuse alist))))) |
| 7504 | buffer window 'reuse alist display-buffer-mark-dedicated))))) | ||
| 7505 | 7538 | ||
| 7506 | (defun display-buffer--maybe-at-bottom (buffer alist) | 7539 | (defun display-buffer--maybe-at-bottom (buffer alist) |
| 7507 | (let ((alist (append alist `(,(if temp-buffer-resize-mode | 7540 | (let ((alist (append alist `(,(if temp-buffer-resize-mode |
| @@ -7533,21 +7566,17 @@ selected frame." | |||
| 7533 | (setq bottom-window window)))) | 7566 | (setq bottom-window window)))) |
| 7534 | nil nil 'nomini) | 7567 | nil nil 'nomini) |
| 7535 | (or (and bottom-window-shows-buffer | 7568 | (or (and bottom-window-shows-buffer |
| 7536 | (window--display-buffer | 7569 | (window--display-buffer buffer bottom-window 'reuse alist)) |
| 7537 | buffer bottom-window 'reuse alist display-buffer-mark-dedicated)) | ||
| 7538 | (and (not (frame-parameter nil 'unsplittable)) | 7570 | (and (not (frame-parameter nil 'unsplittable)) |
| 7539 | (let (split-width-threshold) | 7571 | (let (split-height-threshold) |
| 7540 | (setq window (window--try-to-split-window bottom-window alist))) | 7572 | (setq window (window--try-to-split-window bottom-window alist))) |
| 7541 | (window--display-buffer | 7573 | (window--display-buffer buffer window 'window alist)) |
| 7542 | buffer window 'window alist display-buffer-mark-dedicated)) | ||
| 7543 | (and (not (frame-parameter nil 'unsplittable)) | 7574 | (and (not (frame-parameter nil 'unsplittable)) |
| 7544 | (setq window (split-window-no-error (window-main-window))) | 7575 | (setq window (split-window-no-error (window-main-window))) |
| 7545 | (window--display-buffer | 7576 | (window--display-buffer buffer window 'window alist)) |
| 7546 | buffer window 'window alist display-buffer-mark-dedicated)) | ||
| 7547 | (and (setq window bottom-window) | 7577 | (and (setq window bottom-window) |
| 7548 | (not (window-dedicated-p window)) | 7578 | (not (window-dedicated-p window)) |
| 7549 | (window--display-buffer | 7579 | (window--display-buffer buffer window 'reuse alist))))) |
| 7550 | buffer window 'reuse alist display-buffer-mark-dedicated))))) | ||
| 7551 | 7580 | ||
| 7552 | (defun display-buffer-in-previous-window (buffer alist) | 7581 | (defun display-buffer-in-previous-window (buffer alist) |
| 7553 | "Display BUFFER in a window previously showing it. | 7582 | "Display BUFFER in a window previously showing it. |
| @@ -7596,7 +7625,8 @@ above, even if that window never showed BUFFER before." | |||
| 7596 | ;; anything we found so far. | 7625 | ;; anything we found so far. |
| 7597 | (when (and (setq window (cdr (assq 'previous-window alist))) | 7626 | (when (and (setq window (cdr (assq 'previous-window alist))) |
| 7598 | (window-live-p window) | 7627 | (window-live-p window) |
| 7599 | (not (window-dedicated-p window))) | 7628 | (or (eq buffer (window-buffer window)) |
| 7629 | (not (window-dedicated-p window)))) | ||
| 7600 | (if (eq window (selected-window)) | 7630 | (if (eq window (selected-window)) |
| 7601 | (unless inhibit-same-window | 7631 | (unless inhibit-same-window |
| 7602 | (setq second-best-window window)) | 7632 | (setq second-best-window window)) |