我想为不同的角色定义一堆面孔,如下所示:
(defface char-face-a
'((((type tty) (class color)) (:background "yellow" :foreground "black"))
(((type tty) (class mono)) (:inverse-video t))
(((class color) (background dark)) (:background "yellow" :foreground "black"))
(((class color) (background light)) (:background "yellow" :foreground "black"))
(t (:background "gray")))
"Face for marking up A's"
:group 'char-faces)
(defface char-face-b
'((((type tty) (class color)) (:background "red" :foreground "black"))
(((type tty) (class mono)) (:inverse-video t))
(((class color) (background dark)) (:background "red" :foreground "black"))
(((class color) (background light)) (:background "red" :foreground "black"))
(t (:background "gray")))
"Face for marking up B's"
:group 'char-faces)
...
...
无论如何要避免显式编写所有defface
定义并减少代码冗余?(我知道make-face
,但它似乎已被弃用,并且不能像defface
这样根据不同的终端类型设置属性。)