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

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

Re: New balance-windows


From: Lennart Borgman
Subject: Re: New balance-windows
Date: Sun, 07 Aug 2005 04:17:21 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Pascal Bourguignon wrote:

"Ehud Karni" <ehud@unix.mvs.co.il> 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?




reply via email to

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