Q: how can I shift a window column left and right in a frame?
I use a single frame with multiple windows side-by-side. Usually each window takes up the full height of the frame, but occasionally, one of those windows will be split vertically (eg, when reading mail, the headers above and the message body below).
Now: I often swap buffers from window to window, which is easy enough to do. But: the vertically-split windows almost always contain buffers that logically go together (as in the email example), and I want to move their columns together, rather than just one buffer at a time. In other words, in involves manipulating the window layout itself, rather than just which buffer is visible in which window.
Visual example: I'd like to be able to move the column containing windows (A) and (D) from the left-most column to the middle column:
+-------+-------+-------+ +-------+-------+-------+
| | | | | | | |
| (A) | | | | | (A) | |
| | (B) | (C) | => | (B) | | (C) |
+-------+ | | | +-------+ |
| (D) | | | | | (D) | |
+-------+-------+-------+ +-------+-------+-------+
How can one accomplish this cleanly? I say "cleanly" because I've hacked together something that is pretty slow, pretty ugly, and pretty convoluted -- strong suggesting that I'm Doing It Wrong™.
window.el
split-window
); delete A or D and using thedelete-window
function which permits specifying a specific window; and finally display-buffer B where A or D is.