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: Wed, 02 Apr 2008 14:33:49 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux)

martin rudalics <address@hidden> writes:

>> Because I use split-window-preferred-horizontally the diary buffer is
>> shown in a new window right of the window holding *scratch*.  Now I
>> eval the second `display-buffer' and the right window's buffer is
>> replaced with the *Help* buffer.
>>
>> With `split-height-threshold' set to 20 I get the same behavior.
>> Reading the `display-buffer' docstring I think instead of replacing
>> the right window's buffer it should instead split the left window
>> vertically, cause that's much bigger (61 lines) than the threshold.
>
> You can't see it because you split your windows horizontally.  Try
> with vertical splitting.

Yes.  My point is that it would be better if `display-buffer' would try
to do a non-preferred split before falling back to reusing windows.  We
could change `split-window-preferred-function' to be an alist of split
functions.  Each function gets called, and if it's not able to do an
appropriate split, it returns nil.  If none of the functions splits the
window, `display-buffer's job is to reuse an existing window.

Vanilla emacs would ship with `split-window-functions' set to

  '(split-window-preferred-vertically
    split-window-preferred-horizontally)

Then `split-window-preferred-vertically' has to obey
`split-height-threshold' and `split-window-preferred-horizontally' has
to obey `split-width-threshold'.

Bye,
Tassilo




reply via email to

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