emacs-devel
[Top][All Lists]
Advanced

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

Re: Functions transpose/rotate/flip windows


From: Pranshu Sharma
Subject: Re: Functions transpose/rotate/flip windows
Date: Tue, 28 Jan 2025 15:40:21 +1000
User-agent: Gnus/5.13 (Gnus v5.13)

martin rudalics <rudalics@gmx.at> writes:

>> Ok, incoming
>
> I now added the documentation to the Elisp manual.  Please have a look.

Seems good to me, but I thought we would add this to emacs manual?

>>>> BTW what kind of transofmration would occur, if you had window tree like
>>>>
>>>> (nil W1 (t W2 W3 W4))
>>>> and you transform it to (flip the tree):
>>>> (nil W4 (t W3 W2 W1))
>>>>
>>>> Hard to imagine, could potetnially be another useful thing.
>>>
>>> Can you tell me the sequence of splits needed to get there?
>>
>> C-x {3 o 2 2}
>
> Do you mean C-x 3 C-x o C-x 2 C-x 2?  This gets me a configuration
> different from the one depicted below.

Yeah, they were different examples

>>
>> Here is how the transformation would be
>>
>>   ___________      ___________
>> |           |    |           |
>> |     A     |    |     C     |
>> |___________| -> |___________|
>> |     |     |    |     |     |
>> |  B  |  C  |    |  B  |  A  |
>> |_____|_____|    |_____|_____|
>>
>> IMO this could be useful in the case you have many windows, but are only
>> really working on 2.  Maybe a good name would be flip-windows-cyclicial?
>>
>> Since we already have 'window--transpose-1' that already does the fun
>> stuff, we might as well use it to maximise functionality
>
> You mean to swap A and C only?
>

Yes, because their is an odd number of elements.  This command would
basiclly reverse the (window-list) (or the cyclic odering of windows),
and in reversing, the middle pivot does not get changed if there is one.

 ___________      ___________ 
|           |    |           |
|     A     |    |     D     |
|___________| -> |___________|
|   |   |   |    |   |   |   |
| B | C | D |    | C | B | A |
|___|___|___|    |___|___|___|

Here the since there is even number of windows, no window is where it
was before.

-- 
Pranshu Sharma <https://p.bauherren.ovh>



reply via email to

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