New window commands for emacs
Now in master

1. Intro

Around Augest, in emacs-devel I gave the idea that transpose-frame.el should be merged to master. Well, it turns out the code was faulty and caused some major unwanted side effects.

None of the code or logic from transpose-frame.el made it sadly, the whole thing had to be written again.

To make it work properly, it requires C source change, so I was pretty much disabled when it came to this. Thankfully, the window.el and window.c maintainer, Martin Rudalics, was able to make the change, and helped me understand a lot about the emacs window internals1.

Now all the functionallity of transpose-frame.el and much more is included in emacs master.

2. New functions

All of the functions can work on the subtree if given prefix arg.

The below examples are with simple trees, these commands work on any complex layout you can cook up.

In emacs master, all of these functions should be aviaable in the file window-x.el.

2.1. Transpose windows transpose-window-layout

This one is basiclly diagonal reflection.

0.png

2.2. Rotate windows

2.2.1. clockwise rotate-window-layout-clockwise

1.png

2.2.2. anti clockwise rotate-window-layout-anticlockwise

  • Note taken on [2025-01-12 Sun]
    The name might change to rotate-window-layout-counterclockwise

2.png

2.3. Flip windows

2.3.1. Horizonatally flip-window-layout-horizontally

3.png

2.3.2. Verticlly flip-window-layout-vertically

4.png

2.4. Rotatate/cycle windows (my faviorate) rotate-windows

Also it this point, it is worth noting all of these destroy and rebuild the window tree. This means for the following functions, all the window properties should be moved.

5.png

2.4.1. Back rotate-windows-back

6.png

3. Conclusion

Emacs goes yet another step ahead of vim.

Footnotes:

1

Much more complex than I initally thought