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, 21 Oct 2024 10:14:41 +0200
User-agent: Mozilla Thunderbird

> I thought that for each layout, there is only one possible window tree
> that will match it.

I think so too.  But there are infinite many ways to obtain that layout.

>> Your strategy of deleting windows piecemeal destroys the original window
>> structure in a quite chaotic way.
>
> The problem is that it will fail when only acting upon a partial subtree.

I see.  I think I have to give 'delete-other-windows' an additional
argument say MAIN so it checks whether WINDOW is in MAIN's subtree and
puts WINDOW in the place of MAIN in that subtree.  You would call it
with MAIN set to the root of the subtree and WINDOW to fwin.

Note again: When you delete windows one by one you may change the
parents of the windows that remain but you want to delete afterwards.
But 'split-window' should work with the parent windows that existed
_before_ you started deleting.  So maybe you should first try to
experiment with 'delete-other-windows' as it is now and then we can try
to fix 'delete-other-windows' the way I sketched above.

> I see what you mean here, I knew I should done something like this from
> the start when I had to flatten the window subtree.
>
> Seems like this will require a rewrite of the windows--transpose-1
> (Yay!), but it should be doable, I have an idea of what I could do.

I cannot exclude that one can also get good results by using your
current approach.  As I said above, there are many ways to obtain a
specific layout.

> btw, is there a major perfomance/memory footprint of the patches you are
> adding

In which sense?  Reusing windows should reduce GC overhead since you
create less new windows and produce less obsolete ones.  Everything else
is negligible.

martin



reply via email to

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