emacs-devel
[Top][All Lists]
Advanced

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

Re: window groups


From: Thomas Lord
Subject: Re: window groups
Date: Sat, 31 May 2008 10:22:07 -0700
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

martin rudalics wrote:
> Where is "here"? Your local changes? Because that's at least three
> more args than the standard split-window accepts.

My local changes.  Have a look at the description that started this
thread.


Aha!  That's why I couldn't find it.

I have a suggestion about the description that started this
thread but, first, to clear up a misunderstanding:

In the other message you answered one of my questions:

>>> Returning "precisely" to former sizes is non-trivial.

>> How so?

> Because your context might have changed in between.  For example, when
> leaving a `save-window-excursion' you don't want your frame get resized.


Context got lost in the quoting there and caused confusion.

When a temporary window or a pop-up created by splitting the root
of a frame is deleted *and* the user hasn't otherwise touched the
window configuration, *then* precise sizes should be restored.
So, if a user resizes a frame or explicitly resizes, deletes, or splits
a window it doesn't matter as much.   But if none of those things have
happened since the pop-up, the precise sizes should be restored.

That would *almost* happens automatically but not quite.

Currently, if you delete one of the windows in (say) a horizontal
stack, then by default the new space is allocated proportionally among
the remaining windows.   That won't always DTRT in the case of
pop-ups that split the root of the frame.   For example, before the
pop-up, a stack of windows may have each had an exactly equal
number of lines.   When the pop-up appears, the remaining lines
might not divide evenly among the other windows in the stack -
so they are no longer all the same size.   When the pop-up disappears,
Emacs won't always restore them to be all the same size.

That's the case I was talking about fixing and I was talking about
fixing it only in a very narrow case: that the user hasn't done anything
to change the window configuration other than triggering the pop-up
window and then dismissing the pop-up window.

So, back to the original description:

For various reasons I found the original description really difficult
to understand and believe in.   Other people have already pointed out
some ways in which it "isn't lispy".   I would add that it is pretty
complicated but only a weak rationale is given for the complexity.
It's complicated because it adds 3 parameters (that seem hard to
explain) to split-window.   It's complicated because it adds a new
primitive concept (window groups) and that concept comes with
non-intuitive restrictions (like the non-nesting of groups and the
non-existence of single-window groups).

I take your word for it that, given those new features, you can implement
something that looks a lot like certain other IDEs.   On the other hand,
these features don't obviously have many other uses besides that - they
aren't very "general," at least as far as I can tell from the description.

Here is the thing, though:

Presumably you want to use the new features you're working on and then
build higher-level application code to actually implement IDE features.
Let's just assume that all of your higher level code (actual or planned) is
just fine but ask: is there a simpler, more general substitute for the low-level
changes?

Stefan tells me that "window properties" are being added at this time.

Emacs already has a lot of handy "hooks" to catch significant events
as, for example, the window-configuration-change-hook

Well, how about this?   Modify split-window with just one new additional
parameter which, if that parameter is 'root, then a top-level split is implied.
If that parameter is nil, current behavior is implied.   No other values for
that parameter should be defined yet.

I *suspect* (and its only a suspicion) that those alone are sufficient to
accomplish everything you are trying to do with window groups, without
even very much pain (and, perhaps with some added flexibility).

No?

Not to confuse things too much but let me also suggest how, in the future,
the new split-window parameter that might be 'root could take on other
values.   Every window is conceptually part of both a horizontal and
vertical stack of windows, containing 1 or more windows.   One possibility
is that if the new split-window parameter is a window, then the pop-up
splits off the entire horizontal or vertical stack of which that window is
a part.   This is a sneaky way to "expose the window tree to lisp" as Mile's
puts it.   (Additional sneakiness would be a function that, given a window,
returns an ordered list of all windows in the same horizontal or vertical
stack.)

That would have use in IDE-style interfaces.   For example, suppose that
down the screen on the left are a series of narrow "navigation" windows
and on the right there is an edit area, an interaction area, and a debugger
area.    A "help window pop-up" could usefully be constrained to take
up space just on the right of the screen. That would be a natural generalization
of using 'root and having it take up space on the whole screen.

-t





reply via email to

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