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: Sat, 25 Jan 2025 20:18:25 +1000
User-agent: Gnus/5.13 (Gnus v5.13)

martin rudalics <rudalics@gmx.at> writes:

>> |-------|     ---------
>> |   A   |     |   A   |
>> |-------| OR  |-------|
>> | B | C |     | B | C |
>> |_______|     |_______|
>
> What I had in mind was
>   ___________       ___________
>  |           |     |     |     |
>  |     A     |     |     |  B  |
>  |___________| --> |  A  |_____|
>  |     |     |     |     |     |
>  |  B  |  C  |     |     |  C  |
>  |_____|_____|     |_____|_____|
>

Ok, incoming

Transpose
 ___________       ___________ 
|           |     |     |     |
|     A     |     |     |  B  |
|___________| --> |  A  |_____|
|     |     |     |     |     |
|  B  |  C  |     |     |  C  |
|_____|_____|     |_____|_____|


Rotate clockwise
 ___________       ___________ 
|           |     |     |     |
|     A     |     |  B  |     |
|___________| --> |_____|  A  |
|     |     |     |     |     |
|  B  |  C  |     |  C  |     |
|_____|_____|     |_____|_____|


Rotate anticlockwise
 ___________       ___________ 
|           |     |     |     |
|     A     |     |     |  C  |
|___________| --> |  A  |_____|
|     |     |     |     |     |
|  B  |  C  |     |     |  B  |
|_____|_____|     |_____|_____|

Flip vert

 ___________       ___________ 
|           |     |     |     |
|     A     |     | B   |  C  |
|___________| --> |_____|_____|
|     |     |     |           |
|  B  |  C  |     |     A     |
|_____|_____|     |___________|


horizontally

 ___________        ___________ 
|           |      |           |
|     A     |      |     A     |
|___________| -->  |___________|
|     |     |      |     |     |
|  B  |  C  |      |  C  |  C  |
|_____|_____|      |_____|_____|

rotate
 ___________        ___________ 
|           |      |           |
|     A     |      |     C     |
|___________| -->  |___________|
|     |     |      |     |     |
|  B  |  C  |      |  A  |  B  |
|_____|_____|      |_____|_____|

rotate back

 ___________        ___________ 
|           |      |           |
|     A     |      |     B     |
|___________| -->  |___________|
|     |     |      |     |     |
|  B  |  C  |      |  C  |  A  |
|_____|_____|      |_____|_____|


>
>> 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}

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

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



reply via email to

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