emacs-devel
[Top][All Lists]
Advanced

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

Re: Add function to rotate/transpose all windows


From: martin rudalics
Subject: Re: Add function to rotate/transpose all windows
Date: Mon, 11 Nov 2024 17:55:37 +0100
User-agent: Mozilla Thunderbird

>> IIRC I fixed that earlier by binding 'window-combination-limit'
>> appropriately.
>
> I still wasn't able to get it work using that, but what I think will
> work is `window-combination-resize'.

This won't do what you want - it will simply give all windows the same
relative size, something 'balance-windows' does.  But you want to
preserve the relative sizes of windows.  Try with my algorithm - it
preserves proportional sizes quite well.

> How about setting a window configuration, then splitting the window, and
> it goes boom-boom,  we can just revert to that?

That's exactly what my algorithm does: It automatically restores the old
configuration and prints a message about what went wrong.>
>>> ngl, when you say it like that it sounds like I am making food for a
>>> kim
>>> jong ung
>>
>> It's more like making a diet plan for him.
>
> If I was Kim, I wouldn't mind some extra ice cream at the cost of just
> another kg


> It is simply not possible then to rotate or transpose windows if they
> are fixed size, imagine a fixed size top level split function, how would
> that get rotated?

Emcas ignores the fixed-sizeness when it has no other choice.  Like when
you delete a window and the only remaining window on the frame is of
fixed size.  But first of all flipping windows should always preserve
fixed sizes.  And rotating windows should at least try to do that.

> I think maybe we can do a map windows at the start to check if any are
> fixed size, and if yes then we stop.
>
> So so far, my game plan is I won't do any of the window alist stuff,
> rather just the normal window-pixel-tree but include internal windows as
> well.

The alist approach has one decisive advantage: When you later find out
that you would like to know a specific window property before you delete
windows you can simply add that property.  With the pixel-tree approach
you will have to add it to the pixel tree and get one "a" more in the
ca..rs you use for accessing the tree's elements.

And, as you can see from the function 'window-alist-check', it's fairly
easy to compare the alists before and after rotation.  Try to write a
similar comparison algorithm with pixel-trees.

martin




reply via email to

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