help-gnu-emacs
[Top][All Lists]
Advanced

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

re-generating a window-configuration by program


From: Klaus Berndl
Subject: re-generating a window-configuration by program
Date: 19 Dec 2003 09:06:55 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Hi,

suppose you have a list of windows of a frame (got by `window-list') and for
each window its edges (got by `window-edges') - all of this stored in a
suitable manner in an alist for example. This is something similar what
`current-window-configuration' returns but not a hidden data-structure but an
"open" list-structure.

Let us say we have a frame splitted in several arbitrary windows and we have
stored such a "hand-made" window-configuration for this frame in a variable
named `my-own-window-config'.

OK, then i want to do the following:
1. Calling `delete-other-windows' so this frame contains only one window.
2. Calling an algorithm which goes through the window-config in
   `my-own-window-config' and re-generates the original window-layout the
   frame had before step 1. This re-generation has to be done by running all
   needed calls to split-window-vertically, split-window-horizontally,
   enlarge-window, shrink-window.

Does anybody know such an algorithm which goes through a list of windows and
its edge-coordinates and rebuilds only with this information the specified
window-layout?

I know there is `current-window-configuration' etc. but for my purpose this is
not applicable because i want to apply this algorithm only to a part of a
frame:

   -------------------------------------------------------
   |              |                                      |
   |              |                                      |
   |              |                                      |
   |       A      |                 E                    |
   |              |                                      |
   |              |                                      |
   |              |                                      |
   |              |                                      |
   |              |                                      |
   |--------------|                                      |
   |       B      |                                      |
   -------------------------------------------------------
   |                                                     |
   |                    C                                |
   |                                                     |
   -------------------------------------------------------


I have already a program which generates the layout above, means it splits the
frame in the windows A, B, C and E. Now suppose someone splits the window E in
arbitrary "subwindows"... Then i want to store the window-layout of the area E
as a window-config like described above. Then a special window-deleter
restores the layout above (i.e. unsplits only area E) and then i want to run
the algorithm i asked for to restore the splitted layout of area E.

Is this problem described understandable?

All hints for this algorithm (maybe already implemented something similar in
other elisp-packages) are appreciated.

Thanks a lot in advance!
Klaus


   
-- 
Klaus Berndl                    mailto: address@hidden
sd&m AG                         http://www.sdm.de
software design & management    
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220


reply via email to

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