help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to keep a permanent buffer list open?


From: Sven Bretfeld
Subject: Re: how to keep a permanent buffer list open?
Date: 22 Jan 2010 20:07:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Hi Brendan

Brendan Miller <catphive@catphive.net> writes:

> Basically, I want this to perform the save function that tabs would
> i.e. letting me visually keep track of what files/buffers I have open
> and switch between them with a mouse click. I figure a buffer list
> would be better for keeping track of a large number of buffers, that
> would overflow on a tabbar.

I would suggest a customized tabbar that splits buffers into groups.
The following is what I have. It groups Tabs into Dired, User, Mail and
temporary buffers (*-buffers). Only one group is visible at a time. You
can browse the buffers and groups with the Windows key (super) plus
arrows. You can make your own groups easily by following the same model. 

Hope it helps,

Sven

(defun tabbar-buffer-groups ()
   "Return the list of group names the current buffer belongs to.
 This function is a custom function for tabbar-mode's
 tabbar-buffer-groups. This function group all buffers into 3
 groups: Those Dired, those user buffer, those LaTeX buffer,
 those emacs buffer etc. Emacs buffer are those starting with *."
   (list
    (cond
     ;; ((string-equal "*" (substring (buffer-name) 0 1))
     ;;  "tmp Buffers"
     ;;  )
     ((eq major-mode 'dired-mode)
      "Dired Buffers"
      )
     ((eq major-mode 'latex-mode)
      "User Buffers"
      )
     ((eq major-mode 'bibtex-mode)
      "User Buffers"
      )
     ((eq major-mode 'org-mode)
      "User Buffers"
      )
     ((eq major-mode 'emacs-lisp-mode)
      "User Buffers"
      )
     ((eq major-mode 'message-mode)
      "Gnus Buffers"
      )
     ((eq major-mode 'mail-mode)
      "Gnus Buffers"
      )
     ((eq major-mode 'gnus-group-mode)
      "Gnus Buffers"
      )
     ((eq major-mode 'gnus-summary-mode)
      "Gnus Buffers"
      )
     ((eq major-mode 'gnus-article-mode)
      "Gnus Buffers"
      )
     (t
      "Emacs Buffer"
      )
     )))

(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)

;; «tabbar-keybindings» (to ".tabbar-keybindings")

(global-set-key [(s-right)] 'tabbar-forward)
(global-set-key [(s-left)] 'tabbar-backward)
(global-set-key [(s-up)] 'tabbar-backward-group)
(global-set-key [(s-down)] 'tabbar-forward-group)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]