emacs-devel
[Top][All Lists]
Advanced

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

Re: display-buffer-change


From: David Kågedal
Subject: Re: display-buffer-change
Date: Mon, 10 Sep 2007 08:48:39 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1 (gnu/linux)

martin rudalics <address@hidden> writes:

> Stefan Monnier schrieb:
>>>>I must have lost too much context: I do not understand the
>>>>above description.  Can someone spell it out in baby-steps for my poor
>>>>excuse for a brain?
>>
>>
>>>The OP explained it as follows:
>>
>>
>>>>Split an emacs frame in two windows showing buffers A and B:
>>>>
>>>>+-------------+
>>>>|             |
>>>>|      A      |
>>>>|             |
>>>>+-------------+
>>>>|             |
>>>>|      B      |
>>>>|             |
>>>>+-------------+
>>>>
>>>>While in the lower window, run
>>>>
>>>>(set-window-dedicated-p (selected-window) t)
>>>>
>>>>Now, in the upper window, run
>>>>
>>>>(display-buffer "C")
>>>>
>>>>In Emacs 21, this will be the result:
>>>>
>>>>+-------------+
>>>>|      A      |
>>>>+-------------+
>>>>|      C      |
>>>>+-------------+
>>>>|             |
>>>>|      B      |
>>>>|             |
>>>>+-------------+

Actually, I think that the size of B is diminished somewhat sometimes.

>>>>In Emacs 22, this will be the result:
>>>>
>>>>+-------------+
>>>>|             |
>>>>|      C      |
>>>>|             |
>>>>+-------------+
>>>>|             |
>>>>|      B      |
>>>>|             |
>>>>+-------------+
>>>>
>>>>In Emacs 22 with split-heigh-threshold=10, this will be the result:
>>>>
>>>>+-------------+
>>>>|             |
>>>>|      A      |
>>>>|             |
>>>>+-------------+
>>>>|      B      |
>>>>+-------------+
>>>>|      C      |
>>>>+-------------+
>>>>
>>
>>
>>>What he apparently wants is window B always display the same buffer, stay
>>>below all other windows, and not change its size.
>>
>>
>> I guess I see the following problems:
>> 0 - it's not clear to me why Emacs chooses to split B rather than A.
>>     It seems unrelated to the split-height-threshold fix, so we need to look
>>     into this before being able to determine how best to fix it.
>
> Fget_largest_window returns the largest window and B could be that
> window.
>
>> 1 - since we're in buffer/window A, it would probably be preferable to place
>>     buffer C closer rather than further, so in this case after splitting B
>>     display-buffer should prefer using the top window for C and the bottom
>>     one for B.
>
> With `split-window' the new window is the lower one, we would lose all
> associations for B if we did that.
>
>
>> 2 - "dedicated" is mostly meant to cause deletion of the buffer to also
>>     cause deletion of the window.  It says nothing about the window having
>>     a fixed size or being non-splittable.
>
> Agreed.

Having a fixed size is not important for me.  The most important
property for me is that it remains being fixed at the bottom of the
frame.  This seemed to hold in Emacs 21, which made me happy. But it
might have been unintended.

>> 3 - we have window-size-fixed for that.
>
> David: Could you set that for the buffer of your window B and look
> whether it gives good results.

No, it gives me an error: "Attempt to split fixed-size window".

I think the (short) instructions at the top should be enough for you
to reproduce it as well.

>> 4 - we don't have window-(un)splittable for that (there's a frame parameter
>>     to prevent splitting windows in that frame, tho).
>
> Earlier I thought about splitting obey a buffer-local value for
> `split-height-threshold'.
>

-- 
David Kågedal




reply via email to

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