[Top][All Lists]

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

Re: display-buffer-alist simplifications

From: Juri Linkov
Subject: Re: display-buffer-alist simplifications
Date: Tue, 16 Aug 2011 12:33:34 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

>> I have made window minimum heights (aka `split-height-threshold') alist
>> members although, as Juri mentioned earlier, these are actually part of
>> the enabling condition (or the action).  Where really put these?
> The CONDITION is only concerned with the buffer to display, so things
> like minimum window height is not part of the CONDITION.  It definitely
> belongs in the ALIST.

I agree that window minimum heights would be too fine-grained
for the CONDITION part.  It's better suitable for the ALIST.

I think that important part of design is functional decomposition
to implement minimal building blocks that can be easily combined
to define a buffer-displaying behavior.

To continue this discussion, I propose to think about the complexity
of implementing a `display-buffer-near-minibuffer' function.
How easy it would be to do by using existing functions
(and ignoring `display-buffer-alist' awhile)?

I imagine an algorithm like this:

1. Try to reuse a window dedicated to the buffer to be displayed.

2. Try to reuse a window at the bottom with the width of the selected frame.
   Alternatively, provide a parameter for the ALIST to skip this step.
   Also provide a parameter to resize the reused window.

3. Otherwise, taking into account min-height try to create a new window
   with the specified height at the bottom of the selected frame.

4. Otherwise, reuse any available window on the selected frame.
   Provide a parameter to define the order of different methods:
   largest, lru, rightmost, etc.

5. Alternatively, with preference of using frames, try to find
   a dedicated frame.  Otherwise, create a new frame with
   specified parameters.

Is it possible to write that now using simple function calls?

reply via email to

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