Skip to content

Instantly share code, notes, and snippets.

@juergenhoetzel
Created December 1, 2011 11:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juergenhoetzel/1415844 to your computer and use it in GitHub Desktop.
Save juergenhoetzel/1415844 to your computer and use it in GitHub Desktop.
Rotate windows to left
(require 'cl)
(defun rotate-left (l) (append (cdr l) (list (car l))))
(defun rotate-windows ()
(let ((start-positions (rotate-left (mapcar 'window-start (window-list))))
(buffers (rotate-left (mapcar 'window-buffer (window-list)))))
(mapcar* (lambda (window buffer pos)
(set-window-buffer window buffer)
(set-window-start window pos))
(window-list)
buffers
start-positions)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment