I am borrowing this from the emacs wiki.
;; for swaping buffers between frames when the window is split (defun transpose-buffers (arg) “Transpose the buffers shown in two windows.” (interactive “p”) (let ((selector (if (>= arg 0) ‘next-window ‘previous-window))) (while (/= arg 0) (let ((this-win (window-buffer)) (next-win (window-buffer (funcall selector)))) (set-window-buffer (selected-window) next-win) (set-window-buffer (funcall selector) this-win) (select-window (funcall selector))) (setq arg (if (plusp arg) (1- arg) (1+ arg)))))) (global-set-key (kbd “C-x 4 t”) ‘transpose-buffers)
I have been meaning to find a solution for this for a while. Emacs Wiki, you guide me well. Repeating to self five times: “Command four tee”, “Command 40”, “Command 4 t”, “Command four t”, “Command 4 tee” That should stick for a few hours so I can use it a few times.