[Top][All Lists]

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

Re: MY window tree!

From: Lennart Borgman (gmail)
Subject: Re: MY window tree!
Date: Sun, 14 Jan 2007 10:35:33 +0100
User-agent: Thunderbird (Windows/20061207)

martin rudalics wrote:
 > I've been playing around with window-tree to do the following :
 > - On M-x foo, a window is created on the extreme left of the frame,
 > containing a buffer called *Bar*,
 > - On M-x foo again, with the buffer *Bar* on the left, this window is
 > removed.
 > Problem is, this can't be done with a simple split. So my first idea
 > was to reduce the frame to one window, split it: left would be *Bar*
 > and restore the window-tree in the right part.
 > Of course, this can't work, because if I use delete-other-windows, the
 > windows are ... deleted. So, can't be restored.
 > I can't find a way to do this simply, and I wonder if there is :-)

Don't wonder: You first have to save the window-list of the frame
including all windows' edges and identities.  Next you have to create the
*Bar* window with the intended width and split the window on the right
in the way listed by the saved window-list, adjust the vertical dividers
proportionally to what you had before (there's always a chance that a
window drops below the minimum width now) and assign any window-local
overlays the identity of their new window.  In addition there might be
dedicated windows and other window-local properties as well ...

I once struggled a lot with the much simpler problem of a window
configuration like

| |        |
|1|   2    |
| |        |

I wanted to transform into

|1|   2    |
|   3      |

If you come up with a solution to your problem I'd definitely want to
hear about it ;-)

I have uploaded a preliminary version of winsav.el to

reply via email to

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