Re: New balance-windows

From:

Pascal Bourguignon

Subject:

Re: New balance-windows

Date:

Sat, 06 Aug 2005 22:45:42 +0200

User-agent:

Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Lennart Borgman <address@hidden> writes:
>>
>>I think a correct algorithm should recover the split tree, then make
>>the balancing depending on the window counts in subtrees.
>>
>>
> Is the problem really that welldefined in Emacs? Do you know how the
> windows have been splitted? The difference above may perhaps be seen
> as emerging from that difficulty?
Indeed, but the data is available at least internally, so it should be
easy to patch emacs to publish window parameters like it's done for
frame parameters for example.
File: elisp, Node: Window Internals
Window Internals
----------------
Windows have the following accessible fields:
`frame'
The frame that this window is on.
`mini_p'
Non-`nil' if this window is a minibuffer window.
`parent'
Internally, Emacs arranges windows in a tree; each group of
siblings has a parent window whose area includes all the siblings.
This field points to a window's parent.
Parent windows do not display buffers, and play little role in
display except to shape their child windows. Emacs Lisp programs
usually have no access to the parent windows; they operate on the
windows at the leaves of the tree, which actually display buffers.
The following four fields also describe the window tree structure.
`hchild'
In a window subdivided horizontally by child windows, the leftmost
child. Otherwise, `nil'.
`vchild'
In a window subdivided vertically by child windows, the topmost
child. Otherwise, `nil'.
`next'
The next sibling of this window. It is `nil' in a window that is
the rightmost or bottommost of a group of siblings.
`prev'
The previous sibling of this window. It is `nil' in a window that
is the leftmost or topmost of a group of siblings.
--
__Pascal Bourguignon__ http://www.informatimago.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d? s++:++ a+ C+++ UL++++ P--- L+++ E+++ W++ N+++ o-- K- w---
O- M++ V PS PE++ Y++ PGP t+ 5+ X++ R !tv b+++ DI++++ D++
G e+++ h+ r-- z?
------END GEEK CODE BLOCK------