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: Fri, 8 Nov 2024 16:52:22 +0100
User-agent: Mozilla Thunderbird

>> It might be interesting to try the following variant: Instead of
>> recursing immediately into F1, first split all siblings of F so that one
>> has a layout of
>>
>> F  F1  F2  ... Fn
>>
>> and only now recursively process F1, F2 ... Fn.  This would have the
>> advantage that when splitting F1 to fit in the entire subtree rooted at
>> P1, its size is already the final size.  And we might not have to split
>> parent windows either.  But such a solution will be less trivial to
>> code.
>
> this idea seems pretty good, I don't see any downside to this.  I'll
> have a go at it.  But will this work with your earilier magic patch that
> would somehow automaitclly reconsutruct parent windows?

It wasn't magic - so far I was not able to make it work here.  In all
approaches that work here, I have to pass a (window . parent) cons to
'split-window' as REFER argument.  I do no exclude that one can make it
work but it's not simple and very likely requires the normal window
handling routines to keep an old parent for each window around.

>> Attached find my latest diffs (the documentation has not been completed
>> yet) and window-rotate.el.
>
> I applied the patches, and found your think works well in most cases,
> however it fails to work in windows of file attached

I don't see that here.  IIUC you can get that initial configuration via

C-x 3 C-x o C-x 2 C-x 3 C-x 2 C-x 3 C-x 3

and it rotates fine here.  What are the contents of *foo* after
attempting to rotate?

> Wait, now that I look at it, it does not work for windows with >2
> siblings, for example C-x 3 C-x 3 gives me 'wrong argument type' error

Strange.  If that happened within 'split-window' it should have been
caught by the 'condition-case'.  If it happens elsewhere, you would have
to run it via edebug.  In either case *foo* should tell how far it got.

martin




reply via email to

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