Skip to content

Instantly share code, notes, and snippets.

@imakado
Created June 3, 2009 06:48
Show Gist options
  • Save imakado/122829 to your computer and use it in GitHub Desktop.
Save imakado/122829 to your computer and use it in GitHub Desktop.
(defun anything-c-buffer-list ()
"Return the list of names of buffers with boring buffers filtered out.
Boring buffers is specified by `anything-c-boring-buffer-regexp'.
The first buffer in the list will be the last recently used
buffer that is not the current buffer."
(let* ((buffers (mapcar 'buffer-name (buffer-list)))
(buffers (append (cdr buffers) (list (car buffers))))
(cur-buf-name (with-current-buffer anything-current-buffer
(and (current-buffer)
(buffer-name (current-buffer))))))
(cond
(cur-buf-name
(setq buffers (delete cur-buf-name buffers))
(add-to-list 'buffers cur-buf-name t)
buffers)
(t buffers))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment