我正在尝试在gnus-group-mode中设置主题名称的颜色。我试着查找人脸名称,以便设置颜色属性,但根据我查找的主题的字母,我得到了default或ascii字符作为人脸名称。
通过查找gnus的源代码,我想出了这个函数。然而,在阅读完文档的face部分后,我不确定如何为函数分配一个face (如果这是正确的操作方式)。
(defun gnus-group-topic-name ()
"The name of the topic on the current line."
(let ((topic (get-text-property (point-at-bol) 'gnus-topic)))
(and topic (symbol-name topic))))发布于 2013-04-08 18:28:13
似乎没有为开箱即用的主题定义面孔。这个来自http://www.emacswiki.org/emacs/GnusFormatting的小片段试图解决这个问题,还为空和非空主题引入了不同的faces:
(setq gnus-topic-line-format "%i[ %u&topic-line; ] %v\n")
;; this corresponds to a topic line format of "%n %A"
(defun gnus-user-format-function-topic-line (dummy)
(let ((topic-face (if (zerop total-number-of-articles)
'my-gnus-topic-empty-face
'my-gnus-topic-face)))
(propertize
(format "%s %d" name total-number-of-articles)
'face topic-face)))该页面还指出,您必须用一些合适的faces替换my-gnus-topic-empty-face和my-gnus-topic-face,或者创建您自己的faces。
https://stackoverflow.com/questions/15869992
复制相似问题