[Top][All Lists]

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

Re: moving window handling into lisp

From: martin rudalics
Subject: Re: moving window handling into lisp
Date: Thu, 13 Aug 2009 15:56:27 +0200
User-agent: Thunderbird (Windows/20090302)

> This one is easier to play with.
>>> Here is the walking down part too. You have to tell me what you are missing.

When I try to evaluate that I get

Window Root-1 is too small, min=9, but can be max=7

Anyway, I do hope to understand what you mean.  When "going up" you
calculate minimum and maximum sizes and when "going down" you distribute
the frame size recursively among its children according to some
"strategy".  When the minimum and maximum sizes can't be applied you
give up before going down.

The problem I see is with the "strategy" that sets the desired sizes.
With 'eq-sizes you calculate them on the fly when you "walk down".
Unfortunately, this won't help when you just want to enlarge one
individual leaf window.  In that case we usually resize one adjacent
window and leave the other windows alone.  You'd probably first set the
min/max values of the window you want to enlarge to the desired value,
relax the min/max values of an adjacent sibling and leave all other
min/max values at the current sizes.  If this works out you're done.

Otherwise, you'd have to relax min/max values for additional windows and
see whether you succeed.  You'd probably start doing that process
"inside out" by selecting siblings of the window you want to enlarge,
siblings of their parent and so on.  That's what I meant with
backtracking.  The complexity of that process is, in the worst case,
proportional to the number of possible Emacs tilings of a frame into the
windows you have.  Obviously, we don't expect the worst case to happen.
But we'd probably need some reasonable divide-and-conquer strategy to
make sure to always get a good result.  Finding such a strategy is the
hard part.

I suppose your approach would handle the case where you simply want to
resize the containing frame.  Just calculate the min/max values and look
whether the desired window sizes fit into that.  After that, adjust the
windows arbitrarily with one line/column more or less.  But with
frame-resizing the hard case is just that we need some heuristics when
windows don't fit due to their hard min-weight/-height, fixed-size


reply via email to

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