Pascal Bourguignon wrote:

"Ehud Karni" <[EMAIL PROTECTED]> writes:

Following the recent discussion of `balance-windows' on help-gnu-emacs
I looked into it and wrote a replacement (new) function based on
somewhat different logic to achieve the balancing.

Thanks very much.  It's nice.  But it's not perfect, see at the end.

...
I think a correct algorithm should recover the split tree, then make
the balancing depending on the window counts in subtrees.
I think Pascal is right. Though I think Ehud has made a very nice try I believe the split tree must be used. There is not enough information to solve the problem otherwise.

Could it perhaps be done like this?:

1) Walk the tree of windows and compute and remember a weight for the childs in the subtree of each window and store that.

2) Walk the tree of windows once again and resize according to the weights from the top of the tree towards the bottom in each branch (recursively of course)!

The weight could be computed as just the sum of childs but I think that should look odd and not be useful. Therefore I suggest that for each level in the subtree the weight is reduced by some factor. Naturally, in the usual mind of Emacs, this could be either a fixed fraction, say 0.7, or a list of fractions.

I believe this should be easy to implement but I might have forgotten something?


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to