aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/window.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el49
1 files changed, 17 insertions, 32 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 3a229a4e447..24d95f367e4 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3785,17 +3785,6 @@ subwindows can get as small as `window-safe-min-height' and
3785 (window-state-put-2 ignore)) 3785 (window-state-put-2 ignore))
3786 (window-check frame)))) 3786 (window-check frame))))
3787 3787
3788(defvar display-buffer-window nil
3789 "Window used by `display-buffer' and related information.
3790After `display-buffer' displays a buffer in some window this
3791variable is a cons cell whose car denotes the window used to
3792display the buffer. The cdr is supposed to be one of the symbols
3793`reuse-buffer-window', `reuse-other-window', `new-window' or
3794`new-frame'.
3795
3796See the function `display-buffer-record-window' for how this
3797variable can be assigned a value.")
3798
3799(defun display-buffer-record-window (type window buffer) 3788(defun display-buffer-record-window (type window buffer)
3800 "Record information for window used by `display-buffer'. 3789 "Record information for window used by `display-buffer'.
3801TYPE must be one of the symbols reuse-window, pop-up-window, or 3790TYPE must be one of the symbols reuse-window, pop-up-window, or
@@ -3804,15 +3793,13 @@ pop-up-frame. WINDOW is the window used for or created by the
3804displayed." 3793displayed."
3805 (cond 3794 (cond
3806 ((eq type 'reuse-window) 3795 ((eq type 'reuse-window)
3807 ;; In `display-buffer-window' record whether we used a window on the 3796 ;; In `help-setup' window parameter record whether we used a window
3808 ;; same buffer or another one. 3797 ;; on the same buffer or another one.
3809 (if (eq (window-buffer window) buffer) 3798 (set-window-parameter
3810 (setq display-buffer-window 3799 window 'help-setup
3811 (cons window 'reuse-buffer-window)) 3800 (if (eq (window-buffer window) buffer) 'reuse-same 'reuse-other))
3812 (setq display-buffer-window 3801 ;; In `quit-restore' parameter record information about the old
3813 (cons window 'reuse-other-window))) 3802 ;; buffer unless such information exists already.
3814 ;; In quit-restore parameter record information about the old buffer
3815 ;; unless such information exists already.
3816 (unless (window-parameter window 'quit-restore) 3803 (unless (window-parameter window 'quit-restore)
3817 (set-window-parameter 3804 (set-window-parameter
3818 window 'quit-restore 3805 window 'quit-restore
@@ -3820,15 +3807,15 @@ displayed."
3820 (window-point window) buffer 3807 (window-point window) buffer
3821 (window-total-size window) (selected-window))))) 3808 (window-total-size window) (selected-window)))))
3822 ((eq type 'pop-up-window) 3809 ((eq type 'pop-up-window)
3823 ;; In `display-buffer-window' record window as new. 3810 ;; In `help-setup' window parameter record window as new.
3824 (setq display-buffer-window (cons window 'new-window)) 3811 (set-window-parameter window 'help-setup 'new-window)
3825 ;; In `quit-restore' parameter record that we popped up this window, 3812 ;; In `quit-restore' parameter record that we popped up this window,
3826 ;; its buffer, and which window was selected before. 3813 ;; its buffer, and which window was selected before.
3827 (set-window-parameter 3814 (set-window-parameter
3828 window 'quit-restore (list 'new-window buffer (selected-window)))) 3815 window 'quit-restore (list 'new-window buffer (selected-window))))
3829 ((eq type 'pop-up-frame) 3816 ((eq type 'pop-up-frame)
3830 ;; In `display-buffer-window' record window as on new frame. 3817 ;; In `help-setup' window parameter record window as on new frame.
3831 (setq display-buffer-window (cons window 'new-frame)) 3818 (set-window-parameter window 'help-setup 'new-frame)
3832 ;; In `quit-restore' parameter record that we popped up this window 3819 ;; In `quit-restore' parameter record that we popped up this window
3833 ;; on a new frame, the buffer, and which window was selected before. 3820 ;; on a new frame, the buffer, and which window was selected before.
3834 (set-window-parameter 3821 (set-window-parameter
@@ -3841,9 +3828,8 @@ means that the currently selected window is not acceptable. It
3841should choose or create a window, display the specified buffer in 3828should choose or create a window, display the specified buffer in
3842it, and return the window. 3829it, and return the window.
3843 3830
3844The function specified here is responsible for setting the value 3831The function specified here is responsible for setting the
3845of `display-buffer-window' and the quit-restore parameter of the 3832quit-restore and help-setup parameters of the window used."
3846window used."
3847 :type '(choice 3833 :type '(choice
3848 (const nil) 3834 (const nil)
3849 (function :tag "function")) 3835 (function :tag "function"))
@@ -3913,8 +3899,8 @@ second. If `special-display-function' specifies some other
3913function, that function is called with the buffer named 3899function, that function is called with the buffer named
3914BUFFER-NAME as first, and the element's cdr as second argument. 3900BUFFER-NAME as first, and the element's cdr as second argument.
3915In any case, that function is responsible for setting the value 3901In any case, that function is responsible for setting the value
3916of `display-buffer-window' and the quit-restore parameter of the 3902The function specified here is responsible for setting the
3917window used. 3903quit-restore and help-setup parameters of the window used.
3918 3904
3919If this variable appears \"not to work\", because you added a 3905If this variable appears \"not to work\", because you added a
3920name to it but the corresponding buffer is displayed in the 3906name to it but the corresponding buffer is displayed in the
@@ -4115,9 +4101,8 @@ A buffer is special when its name is either listed in
4115`special-display-buffer-names' or matches a regexp in 4101`special-display-buffer-names' or matches a regexp in
4116`special-display-regexps'. 4102`special-display-regexps'.
4117 4103
4118The function specified here is responsible for setting the value 4104The function specified here is responsible for setting the
4119of `display-buffer-window' and the quit-restore parameter of the 4105quit-restore and help-setup parameters of the window used."
4120window used."
4121 :type 'function 4106 :type 'function
4122 :group 'frames) 4107 :group 'frames)
4123 4108