我想定義一堆面,用於不同的字符象下面這樣:defface用較少的冗餘
(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
定義,使代碼冗餘少? (我根據作爲defface
做不同的終端類型知道make-face
,但似乎過時,不能設置屬性。)
+1。我將爲包含所有常用屬性的所有面定義一個基礎面,然後從其繼承所有其他面。 –
+1。我在幫助信息中看到:'(make-face FACE&可選的NO-INIT-FROM-RESOURCES) 定義一個名爲FACE(一個符號)的新面孔。 不要直接從Lisp代碼中調用它;請使用defface。「這就是爲什麼我認爲它已被棄用的原因 – RNA
有趣的是,您使用的是什麼Emacs版本?我沒有看到最後一句(關於不在Lisp代碼中使用它)作爲我從Emacs 20到昨天的Emacs 24版本的任何Emacs版本幫助的一部分。 – Drew