Created
November 4, 2013 03:38
-
-
Save bamanzi/7297757 to your computer and use it in GitHub Desktop.
anything-tab-list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun anything-c-tab-list () | |
"Return a list of buffer names of current tabbar group. " | |
(unless (and (featurep 'tabbar) | |
tabbar-mode) | |
(error "Error: tabbar-mode not turned on.")) | |
(with-current-buffer anything-c-tab-current-buffer | |
(mapcar #'(lambda (tab) (buffer-name (tabbar-tab-value tab))) | |
(tabbar-tabs (tabbar-current-tabset t))))) | |
(setq anything-c-tab-current-buffer nil) | |
(defvar anything-c-source-tabs | |
'((name . "Buffers of current Tabbar Group") | |
(candidates . anything-c-tab-list) | |
(type . buffer))) | |
;;FIXED: this implementation would change current buffer (to '*anything-tabs*') | |
;; thus leads to wrong group | |
(defun anything-tab-list () | |
"Preconfigured `anything' to list buffers. | |
It is an enhanced version of `anything-for-buffers'." | |
(interactive) | |
(setq anything-c-tab-current-buffer (current-buffer)) | |
(anything :sources '(anything-c-source-tabs | |
anything-c-source-buffer-not-found) | |
:buffer "*anything tabs*" | |
:keymap anything-c-buffer-map)) | |
(global-set-key (kbd "<f5> TAB") 'anything-tab-list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment