Skip to content

Instantly share code, notes, and snippets.

@zhannes
zhannes / gist:3048588
Created July 4, 2012 17:54 — forked from bamanzi/gist:2250340
[emacs] Use frame to group buffers (similar to perspective feature)
;; from https://gist.github.com/2250340
(defun frame-bufs-switch-buffer ()
"Switch buffer, within buffers associated with current frame (`frame-bufs-buffer-list')"
(interactive)
(if (and (fboundp 'frame-bufs-mode)
frame-bufs-mode)
(let* ( (buffers (mapcar 'buffer-name (frame-bufs-buffer-list (selected-frame))))
(buffers-rotated (append (cdr buffers) (cons (car buffers) nil)))
(target (ido-completing-read "Buffer: " buffers-rotated)) )
(switch-to-buffer target))