Emacs 默认没有标签栏,使用 tabbar 这个扩展可以给emacs添加标签栏。参见王垠所写的 emacs elisp 扩展中关于 tabbar.el 的部分或 tabbar mode on Emacs Wiki 。
在 debian/ubuntu 下,包 emacs-goodies-el 即包含众多好用的 emacs 扩展,也包括 tabbar。安装好tabbar后,默认的外观比较素,可通过设置 tabbar-button, tabbar-selected, tabbar-highlight, tabbar-separator (具体各部分的名字可参考 tabbar.el 源文件) 等部分定制tabbar的外观,以配合 color-theme 的外观风格。我在 .emacs 中通过:
03 | (set-face-attribute 'tabbar-default nil |
04 | :family "Vera Sans YuanTi Mono" |
10 | (set-face-attribute 'tabbar-button nil |
11 | :inherit 'tabbar-default |
12 | :box '(:line-width 1 :color "gray30" ) |
15 | (set-face-attribute 'tabbar-selected nil |
16 | :inherit 'tabbar-default |
17 | :foreground "DarkGreen" |
18 | :background "LightGoldenrod" |
19 | :box '(:line-width 2 :color "DarkGoldenrod" ) |
25 | (set-face-attribute 'tabbar-unselected nil |
26 | :inherit 'tabbar-default |
27 | :box '(:line-width 2 :color "gray70" ) |
定制其外观。在 emacs-snapshot 中得到的效果如下: