emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: split-window-preferred-function


From: Tassilo Horn
Subject: Re: split-window-preferred-function
Date: Fri, 04 Apr 2008 14:57:50 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

martin rudalics <address@hidden> writes:

>>>+----------------+--------------------------------+
>>>|                |                                |
>>>|   80 columns   |        160 columns             |
>>>|                |                                |
>>>|                |                                |
>>>|                |                                |
>>>|                |                                |
>>>+----------------+--------------------------------+
>>>
>>>When the right window is wide enough to be split horizontally, and
>>>point is in the left window, what is the best to do here?
>>>
>>>1. display a buffer in the right window without splitting it;
>>>2. split the wide right window horizontally and display a buffer
>>>   in a new window;
>>>3. split the left window vertically (this option is preferable
>>>   for some buffers, e.g. for calendar)
>>
>>
>> By default I'd say the splitting functions only check if the current
>> window is wide/high enough.  So I the case above if horizontal splitting
>> is preferred and split-width-threshold is more than 40, the horizontal
>> splitting function would not be applicable and return nil.  The vertical
>> splitting function is the next and checks if the left window is higher
>> than split-height-threshold (the default should be changed to something
>> like 40).  If it is, then option 3 would be done.  If not, then it would
>> return nil, too.  In that case display-buffer would reuse the LRU window
>> which is the right one.
>>
>> I think that's a sensible default.  Users are free to add other
>> functions.  For example the splitting functions could be extended to
>> search through all windows of the current frame to find one that's large
>> enough for a horizontal/vertical split.
>
> Sounds reasonable.  Currently, `display-buffer' searches for the
> largest window and tries to split it regardless of which window is
> selected.  It usually doesn't because the default value of
> `split-height-threshold' prevents splitting.

Ah, ok.  Then using the largest window for splitting should stay the
default, with sensible default values for
split-{width,height}-threshold, e.g. 80 and 40.

Bye,
Tassilo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]