[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: pop-up-windows value to force a new window
From: |
Drew Adams |
Subject: |
RE: pop-up-windows value to force a new window |
Date: |
Tue, 5 Sep 2006 14:33:38 -0700 |
> I don't see a good way to force `display-buffer' and related
> functions to always use another window, even when there is
> more than one window displayed currently. Is there some way
> (besides defining `display-buffer-function'
> in such a way that it does this)?
First, you need to define what "always use another window"
means. What if
the current frame is divided into so many windows (or is itself
so small)
that no splitting can occur because of the minimum window size
variables?
What if the current frame is unsplittable (where you shouldn't split it
automatically), or worse is a minibuffer-only frame that you -can't-
split?
Yes, of course. Before heading down the highway, corner cases would need to
be dealt with.
> This would let Lisp code, for example, bind to that value, and be sure
> that
> `display-buffer' etc. will always create a new window. Subsequently
> deleting
> that window will not leave fewer windows than before the display. IOW,
> this
> would let you use `display-buffer' to always pop up an extra window.
If you want to "not leave fewer windows", what you probably want is to
restore the window configuration. If that's what you want, just do it:
use `current-window-configuration' and
`set-window-configuration'. (There
are a few other useful related functions which can be found
with Apropos.)
If it interests, I have written a small "temporary window
configurations"
package which aims to automate that process.
I don't really recall what I was trying to do. I believe that I started with
`with-output-to-temp-buffer', and I wanted to have it always open a new
window, so deleting that window would not reduce the original config. IIRC,
I tried to use `save-window-configuration' with it, but things didn't
proceed as I wanted. I don't remember the details, and I don't have time now
to look into it.