[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lru-window, window--try-to-split-window, split-width-threshold
From: |
martin rudalics |
Subject: |
Re: lru-window, window--try-to-split-window, split-width-threshold |
Date: |
Fri, 22 Aug 2008 19:02:29 +0200 |
User-agent: |
Thunderbird 2.0.0.16 (Windows/20080708) |
> `split-width-threshold' was apparently introduced recently. Depending on its
> value, the lru-window can now get split horizontally to display *Completions*
> during minibuffer input.
>
> I have code that changes the display of completions (columns, spacing etc.),
> depending on the width *Completions* will have when it is displayed. Before it
> is displayed, I obtain (window-width (get-lru-window)) and use that as the
> assumed window width.
>
> This is no longer adequate, however, because the effective width might be,
say,
> half of that if the lru window gets split horizontally to display
*Completions*.
> And I can't simply use half of that width systematically, because there might
be
> no horizontal split, depending on `split-width-threshold'. I don't know a way
to
> know ahead of time whether a horizontal split will occur (without reproducing
> all of the code/logic of `window--try-to-split-window' - checking for
dedicated
> windows etc.).
So you can't fill the buffer _after_ the splitting occurred? Relying on
someone else to always choose the LRU window is not very clean in the
first place.
> I tried this: (window--try-to-split-window (get-lru-window)), figuring that I
> might as well split the lru-window myself, if it is going to be split, so
that
> I can get its new width and use that.
>
> The problem with this is that once the split occurs the window that was split
is
> apparently no longer the lru window, so *Completions* gets displayed by
> splitting yet another window.
Are you sure? The LRU status changes with `select-window' IIUC.
> If I have two full-frame-width windows (frame
> split vertically), the effect is that both windows get split when
*Completions*
> is displayed (and then unsplit when *Completions* is finished).
>
> Any suggestions? What am I missing? Is there some way, say, after splitting
the
> lru window myself, that I can make it (or the new one) the lru again, so that
> `display-buffer' will use it for *Completions*? IOW, is there a way to *set*
the
> lru window? Any help is welcome.
The only way I currently can think of is a dolist selecting all other
windows but the one you've chosen.
martin