diff options
Diffstat (limited to 'lisp/window.el')
| -rw-r--r-- | lisp/window.el | 49 |
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. | ||
| 3790 | After `display-buffer' displays a buffer in some window this | ||
| 3791 | variable is a cons cell whose car denotes the window used to | ||
| 3792 | display 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 | |||
| 3796 | See the function `display-buffer-record-window' for how this | ||
| 3797 | variable 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'. |
| 3801 | TYPE must be one of the symbols reuse-window, pop-up-window, or | 3790 | TYPE 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 | |||
| 3804 | displayed." | 3793 | displayed." |
| 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 | |||
| 3841 | should choose or create a window, display the specified buffer in | 3828 | should choose or create a window, display the specified buffer in |
| 3842 | it, and return the window. | 3829 | it, and return the window. |
| 3843 | 3830 | ||
| 3844 | The function specified here is responsible for setting the value | 3831 | The function specified here is responsible for setting the |
| 3845 | of `display-buffer-window' and the quit-restore parameter of the | 3832 | quit-restore and help-setup parameters of the window used." |
| 3846 | window 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 | |||
| 3913 | function, that function is called with the buffer named | 3899 | function, that function is called with the buffer named |
| 3914 | BUFFER-NAME as first, and the element's cdr as second argument. | 3900 | BUFFER-NAME as first, and the element's cdr as second argument. |
| 3915 | In any case, that function is responsible for setting the value | 3901 | In any case, that function is responsible for setting the value |
| 3916 | of `display-buffer-window' and the quit-restore parameter of the | 3902 | The function specified here is responsible for setting the |
| 3917 | window used. | 3903 | quit-restore and help-setup parameters of the window used. |
| 3918 | 3904 | ||
| 3919 | If this variable appears \"not to work\", because you added a | 3905 | If this variable appears \"not to work\", because you added a |
| 3920 | name to it but the corresponding buffer is displayed in the | 3906 | name 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 | ||
| 4118 | The function specified here is responsible for setting the value | 4104 | The function specified here is responsible for setting the |
| 4119 | of `display-buffer-window' and the quit-restore parameter of the | 4105 | quit-restore and help-setup parameters of the window used." |
| 4120 | window used." | ||
| 4121 | :type 'function | 4106 | :type 'function |
| 4122 | :group 'frames) | 4107 | :group 'frames) |
| 4123 | 4108 | ||