Kim F. Storm wrote:

Lennart Borgman <[EMAIL PROTECTED]> 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.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to