Created
April 7, 2012 09:00
-
-
Save Johniel/2326684 to your computer and use it in GitHub Desktop.
This file contains 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
;; remove left/right tabs | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(defun tabbar-tab-index(ctabs ctab) | |
(let ((index 0) | |
(head '()) | |
(rest ctabs)) | |
(while (not (eq ctab (car rest))) | |
(incf index) | |
(setq head (append head (list (car rest)))) | |
(setq rest (cdr rest))) | |
index)) | |
(defun tabbar-remove (fn) | |
(let* ((ctabset (tabbar-current-tabset 't)) | |
(ctabs (tabbar-tabs ctabset)) | |
(ctab (tabbar-selected-tab ctabset))) | |
(if (and ctabset ctabs ctab (or (eq fn 'nthcar) (eq fn 'nthcdr))) | |
(mapcar (lambda (tab) | |
(kill-buffer (car tab))) | |
(funcall fn (+ (if (eq fn 'nthcdr) +1 0) | |
(tabbar-tab-index ctabs ctab)) | |
ctabs))))) | |
(defun tabbar-remove-right () | |
(interactive) | |
(tabbar-remove 'nthcdr)) | |
(defun tabbar-remove-left () | |
(interactive) | |
(tabbar-remove 'nthcar)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment