Skip to content

Instantly share code, notes, and snippets.

@ivoscc
Created March 31, 2014 17:06
Show Gist options
  • Save ivoscc/9897037 to your computer and use it in GitHub Desktop.
Save ivoscc/9897037 to your computer and use it in GitHub Desktop.
(defun persp-cycle ()
"Cycle throught the available perspectives."
(interactive)
(let ((next-pos (1+ (persp-curr-position)))
(list-size (length (persp-all-names))))
(cond ((eq 1 list-size) (persp-switch nil))
((>= next-pos list-size) (persp-switch (nth 0 (persp-all-names))))
(t (persp-next)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment