Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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