(defun swap-window-positions () "Swap the positions of this window and the next one. gildea Nov 88" (interactive) (let ((other-window (next-window (selected-window) 'no-minibuf))) (let ((other-window-buffer (window-buffer other-window)) (other-window-hscroll (window-hscroll other-window)) (other-window-point (window-point other-window)) (other-window-start (window-start other-window))) (set-window-buffer other-window (current-buffer)) (set-window-hscroll other-window (window-hscroll (selected-window))) (set-window-point other-window (point)) (set-window-start other-window (window-start (selected-window))) (set-window-buffer (selected-window) other-window-buffer) (set-window-hscroll (selected-window) other-window-hscroll) (set-window-point (selected-window) other-window-point) (set-window-start (selected-window) other-window-start)) (select-window other-window)))