emacs-devel
[Top][All Lists]
Advanced

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

Re: balance-windows again


From: Lennart Borgman
Subject: Re: balance-windows again
Date: Fri, 16 Sep 2005 14:44:55 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Kim F. Storm wrote:

Lennart Borgman <address@hidden> writes:

Is there any possibility that access to the window split tree from
elisp could be implemented in Emacs?

What format would you like the data to have ?
A tree where the nodes are the splits and the leaves are the windows.

This does not have to be fast and it is not big. In bw.el I use a representation where each node is an association list. Here is the tree after C-x 2, C-x 3, C-x 2, C-x 2:

((b . 60)
 (r . 160)
 (t . 0)
 (l . 0)
 (childs ((b . 30)
          (r . 160)
          (t . 0)
          (l . 0)
          (childs ((b . 30)
                   (r . 80)
                   (t . 0)
                   (l . 0)
                   (childs #<window 164 on window.el>
                           #<window 180 on window.el>
                           #<window 179 on window.el>)
                   (dir . ver))
                  #<window 177 on window.el>)
          (dir . hor))
         #<window 1 75 on window.el>)
 (dir . ver))

The keys l, t, r, b are the borders (left, top, right, bottom), similar to what `window-edges' returns. They should NOT be there in the list when you ask for the frames window split tree. (I compute these with bw-refresh-edges.)

A list representation like this is convenient I think. It should be easy to store weights there if someone wants another kind of balancing.




reply via email to

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