1

我正在使用标签栏来定义文件组。一些在“Emacs 缓冲区”组中,其他在“Dired”组中,而所有其他的,ATM,在“用户缓冲区”组中。

我想在使用议程文件时添加另一个组 - 我希望它们出现在一个名为“议程缓冲区”的指定组中,而不是让所有文件都出现在“用户缓冲区”中并乱扔我的选项卡视图”。那怎么可能呢?

目前这是我的配置:

(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, and those emacs buffer.
Emacs buffer are those starting with “*”."
  (list
   (cond
    ((string-equal "*" (substring (buffer-name) 0 1)) "Emacs Buffer")
    ((eq major-mode 'dired-mode) "Dired")
    ((eq major-mode 'sr-mode) "Dired")
    (t "User Buffer")
    )))

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

1 回答 1

2

向函数添加条件,如下所示:

(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, and those emacs buffer.
Emacs buffer are those starting with “*”."
  (list
   (cond
    ((string-equal "*" (substring (buffer-name) 0 1)) "Emacs Buffer")
    ((member (buffer-file-name) (mapcar 'expand-file-name org-agenda-files)) "Agenda")
    ((eq major-mode 'dired-mode) "Dired")
    ((eq major-mode 'sr-mode) "Dired")
    (t "User Buffer")
    )))
于 2013-04-24T13:12:05.140 回答