Mercurial > emacs
comparison src/window.c @ 84505:8bd423438456
(prefer_window_split_horizontally, display_buffer):
Revert 2007-09-08 change.
author | Romain Francoise <romain@orebokech.com> |
---|---|
date | Wed, 12 Sep 2007 11:32:02 +0000 |
parents | 076336b0f3c6 |
children | 1ad5dfad0058 |
comparison
equal
deleted
inserted
replaced
84504:fa4ef512357c | 84505:8bd423438456 |
---|---|
160 Lisp_Object Vdisplay_buffer_function; | 160 Lisp_Object Vdisplay_buffer_function; |
161 | 161 |
162 /* Non-nil means that Fdisplay_buffer should even the heights of windows. */ | 162 /* Non-nil means that Fdisplay_buffer should even the heights of windows. */ |
163 | 163 |
164 Lisp_Object Veven_window_heights; | 164 Lisp_Object Veven_window_heights; |
165 | |
166 /* Non-nil means that windows are split horizontally, i.e. side-by-side, | |
167 instead of vertically by `display-buffer'. An integer value means that | |
168 windows may only be split horizontally if the newly created window is at | |
169 least as wide as that value. */ | |
170 | |
171 Lisp_Object Vprefer_window_split_horizontally; | |
172 | 165 |
173 /* List of buffer *names* for buffers that should have their own frames. */ | 166 /* List of buffer *names* for buffers that should have their own frames. */ |
174 | 167 |
175 Lisp_Object Vspecial_display_buffer_names; | 168 Lisp_Object Vspecial_display_buffer_names; |
176 | 169 |
3658 the buffer, it may be split, subject to the value of the variable | 3651 the buffer, it may be split, subject to the value of the variable |
3659 `split-height-threshold'. | 3652 `split-height-threshold'. |
3660 | 3653 |
3661 If `even-window-heights' is non-nil, window heights will be evened out | 3654 If `even-window-heights' is non-nil, window heights will be evened out |
3662 if displaying the buffer causes two vertically adjacent windows to be | 3655 if displaying the buffer causes two vertically adjacent windows to be |
3663 displayed. | 3656 displayed. */) |
3664 | |
3665 If `prefer-window-split-horizontally' is non-nil, windows are split | |
3666 horizontally, i.e. side-by-side, instead of vertically if possible. If the | |
3667 variable has an integer value, windows may only be split horizontally if the | |
3668 newly created window is at least as wide as that value. */) | |
3669 (buffer, not_this_window, frame) | 3657 (buffer, not_this_window, frame) |
3670 Lisp_Object buffer, not_this_window, frame; | 3658 Lisp_Object buffer, not_this_window, frame; |
3671 { | 3659 { |
3672 register Lisp_Object window, tem, swp; | 3660 register Lisp_Object window, tem, swp; |
3673 struct frame *f; | 3661 struct frame *f; |
3765 #endif | 3753 #endif |
3766 } | 3754 } |
3767 else | 3755 else |
3768 window = Fget_largest_window (frames, Qt); | 3756 window = Fget_largest_window (frames, Qt); |
3769 | 3757 |
3770 /* If we prefer to split horizontally and the window is wide | 3758 /* If the largest window is tall enough, full-width, and either eligible |
3771 enough, split it horizontally. */ | 3759 for splitting or the only window, split it. */ |
3772 if (!NILP (window) | 3760 if (!NILP (window) |
3773 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | 3761 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) |
3774 && WINDOW_FULL_WIDTH_P (XWINDOW (window)) | 3762 && WINDOW_FULL_WIDTH_P (XWINDOW (window)) |
3775 && !NILP (Vprefer_window_split_horizontally) | |
3776 && (!NUMBERP (Vprefer_window_split_horizontally) || | |
3777 (window_width(window) >= | |
3778 2 * XINT (Vprefer_window_split_horizontally))) | |
3779 && (window_width(window)) >= (2 * window_min_width)) | |
3780 { | |
3781 window = Fsplit_window (window, Qnil, Qt); | |
3782 } | |
3783 /* Else, if the largest window is tall enough, full-width, and either | |
3784 eligible for splitting or the only window, split it. */ | |
3785 else if (!NILP (window) | |
3786 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | |
3787 && WINDOW_FULL_WIDTH_P (XWINDOW (window)) | |
3788 && (window_height (window) >= split_height_threshold | 3763 && (window_height (window) >= split_height_threshold |
3789 || (NILP (XWINDOW (window)->parent))) | 3764 || (NILP (XWINDOW (window)->parent))) |
3790 && (window_height (window) | 3765 && (window_height (window) |
3791 >= (2 * window_min_size_2 (XWINDOW (window), 0)))) | 3766 >= (2 * window_min_size_2 (XWINDOW (window), 0)))) |
3792 window = call1 (Vsplit_window_preferred_function, window); | 3767 window = call1 (Vsplit_window_preferred_function, window); |
3793 else | 3768 else |
3794 { | 3769 { |
3795 Lisp_Object upper, lower, other; | 3770 Lisp_Object upper, lower, other; |
3796 | 3771 |
3797 window = Fget_lru_window (frames, Qt); | 3772 window = Fget_lru_window (frames, Qt); |
3798 /* If we prefer to split horizontally and the LRU window is | 3773 /* If the LRU window is tall enough, and either eligible for |
3799 wide enough, split it horizontally. */ | 3774 splitting and selected or the only window, split it. */ |
3800 if (!NILP (window) | 3775 if (!NILP (window) |
3801 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | 3776 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) |
3802 && !NILP (Vprefer_window_split_horizontally) | |
3803 && window_width(window) >= (2 * window_min_width) | |
3804 && (!NUMBERP (Vprefer_window_split_horizontally) || | |
3805 window_width(window) >= | |
3806 (2 * XINT (Vprefer_window_split_horizontally)))) | |
3807 window = Fsplit_window (window, Qnil, Qt); | |
3808 /* Else if the LRU window is tall enough, and either | |
3809 eligible for splitting and selected, or the only window, | |
3810 split it. */ | |
3811 else if (!NILP (window) | |
3812 && ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame)) | |
3813 && ((EQ (window, selected_window) | 3777 && ((EQ (window, selected_window) |
3814 && window_height (window) >= split_height_threshold) | 3778 && window_height (window) >= split_height_threshold) |
3815 || (NILP (XWINDOW (window)->parent))) | 3779 || (NILP (XWINDOW (window)->parent))) |
3816 && (window_height (window) | 3780 && (window_height (window) |
3817 >= (2 * window_min_size_2 (XWINDOW (window), 0)))) | 3781 >= (2 * window_min_size_2 (XWINDOW (window), 0)))) |
3818 window = Fsplit_window (window, Qnil, Qnil); | 3782 window = call1 (Vsplit_window_preferred_function, window); |
3819 else | 3783 else |
3820 window = Fget_lru_window (frames, Qnil); | 3784 window = Fget_lru_window (frames, Qnil); |
3821 /* If Fget_lru_window returned nil, try other approaches. */ | 3785 /* If Fget_lru_window returned nil, try other approaches. */ |
3822 | 3786 |
3823 /* Try visible frames first. */ | 3787 /* Try visible frames first. */ |
7387 | 7351 |
7388 DEFVAR_LISP ("even-window-heights", &Veven_window_heights, | 7352 DEFVAR_LISP ("even-window-heights", &Veven_window_heights, |
7389 doc: /* *If non-nil, `display-buffer' should even the window heights. | 7353 doc: /* *If non-nil, `display-buffer' should even the window heights. |
7390 If nil, `display-buffer' will leave the window configuration alone. */); | 7354 If nil, `display-buffer' will leave the window configuration alone. */); |
7391 Veven_window_heights = Qt; | 7355 Veven_window_heights = Qt; |
7392 | |
7393 DEFVAR_LISP ("prefer-window-split-horizontally", &Vprefer_window_split_horizontally, | |
7394 doc: /* *Non-nil means that windows are split horizontally, i.e. | |
7395 side-by-side, instead | |
7396 of vertically by `display-buffer'. | |
7397 An integer value means that windows may only be split horizontally if the newly | |
7398 created window is at least as wide as that value. */); | |
7399 Vprefer_window_split_horizontally = Qnil; | |
7400 | 7356 |
7401 DEFVAR_LISP ("minibuffer-scroll-window", &Vminibuf_scroll_window, | 7357 DEFVAR_LISP ("minibuffer-scroll-window", &Vminibuf_scroll_window, |
7402 doc: /* Non-nil means it is the window that C-M-v in minibuffer should scroll. */); | 7358 doc: /* Non-nil means it is the window that C-M-v in minibuffer should scroll. */); |
7403 Vminibuf_scroll_window = Qnil; | 7359 Vminibuf_scroll_window = Qnil; |
7404 | 7360 |