1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00

(Fdisplay_buffer): Move call to

Vsplit_window_preferred_function out of conditions that check
if window is eligible for vertical splitting.
When Vsplit_window_preferred_function is non-nil, call it and use
its non-nil return value as window.  Otherwise, continue doing
vertical splitting using Fsplit_window with arg horflag=nil.
(syms_of_window) <Vsplit_window_preferred_function>: Change the
default value from `split-window' to nil.
This commit is contained in:
Juri Linkov 2008-03-29 23:05:26 +00:00
parent f1917c6f19
commit 7ae6d1d10e
2 changed files with 38 additions and 18 deletions

View file

@ -1,3 +1,14 @@
2008-03-29 Juri Linkov <juri@jurta.org>
* window.c (Fdisplay_buffer): Move call to
Vsplit_window_preferred_function out of conditions that check
if window is eligible for vertical splitting.
When Vsplit_window_preferred_function is non-nil, call it and use
its non-nil return value as window. Otherwise, continue doing
vertical splitting using Fsplit_window with arg horflag=nil.
(syms_of_window) <Vsplit_window_preferred_function>: Change the
default value from `split-window' to nil.
2008-03-29 Juri Linkov <juri@jurta.org>
* callint.c (Fcall_interactively): Revert 2008-03-16 change

View file

@ -3848,16 +3848,22 @@ displayed. */)
else
window = Fget_largest_window (frames, Qt);
/* If the largest window is tall enough, full-width, and either eligible
for splitting or the only window, split it. */
if (!NILP (window)
&& ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
&& WINDOW_FULL_WIDTH_P (XWINDOW (window))
&& (window_height (window) >= split_height_threshold
|| (NILP (XWINDOW (window)->parent)))
&& (window_height (window)
>= (2 * window_min_size_2 (XWINDOW (window), 0))))
window = call1 (Vsplit_window_preferred_function, window);
if (!NILP (Vsplit_window_preferred_function))
tem = call1 (Vsplit_window_preferred_function, window);
if (!NILP (tem))
window = tem;
else
/* If the largest window is tall enough, full-width, and either eligible
for splitting or the only window, split it. */
if (!NILP (window)
&& ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
&& WINDOW_FULL_WIDTH_P (XWINDOW (window))
&& (window_height (window) >= split_height_threshold
|| (NILP (XWINDOW (window)->parent)))
&& (window_height (window)
>= (2 * window_min_size_2 (XWINDOW (window), 0))))
window = Fsplit_window (window, Qnil, Qnil);
else
{
Lisp_Object upper, other;
@ -3867,12 +3873,12 @@ displayed. */)
splitting and selected or the only window, split it. */
if (!NILP (window)
&& ! FRAME_NO_SPLIT_P (XFRAME (XWINDOW (window)->frame))
&& ((EQ (window, selected_window)
&& window_height (window) >= split_height_threshold)
|| (NILP (XWINDOW (window)->parent)))
&& (window_height (window)
>= (2 * window_min_size_2 (XWINDOW (window), 0))))
window = call1 (Vsplit_window_preferred_function, window);
&& ((EQ (window, selected_window)
&& window_height (window) >= split_height_threshold)
|| (NILP (XWINDOW (window)->parent)))
&& (window_height (window)
>= (2 * window_min_size_2 (XWINDOW (window), 0))))
window = Fsplit_window (window, Qnil, Qnil);
else
window = Fget_lru_window (frames, Qnil);
/* If Fget_lru_window returned nil, try other approaches. */
@ -7596,9 +7602,12 @@ If there is only one window, it is split regardless of this value. */);
doc: /* Function to use to split a window.
This is used by `display-buffer' to allow the user to choose whether
to split windows horizontally or vertically or some mix of the two.
When this variable is nil, `display-buffer' splits windows vertically.
Otherwise, `display-buffer' calls this function to split a window.
It is called with a window as single argument and should split it in two
and return the new window. */);
Vsplit_window_preferred_function = intern ("split-window");
and return the new window, or return an appropriate existing window
if splitting is not eligible. */);
Vsplit_window_preferred_function = Qnil;
DEFVAR_INT ("window-min-height", &window_min_height,
doc: /* *Delete any window less than this tall (including its mode line).