Skip to content

Instantly share code, notes, and snippets.

@smerritt
Created January 6, 2012 00:57
Show Gist options
  • Save smerritt/1568273 to your computer and use it in GitHub Desktop.
Save smerritt/1568273 to your computer and use it in GitHub Desktop.
;; Take all the windows in the current frame and shift them over one.
;;
;; With 2 windows, effectively switches their positions.
;;
;; With 1 window, this is a no-op.
(defun rotate-windows ()
(interactive)
(let ((buffers (mapcar 'window-buffer (window-list))))
(mapcar* 'set-window-buffer
(window-list)
(append (cdr buffers) (list (car buffers))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment