1

我正在尝试在 gnus-group-mode 中设置主题名称的颜色。我尝试查找人脸名称,以便设置颜色属性,但根据我正在查找的主题的字母,我将默认或 ascii 字符作为人脸名称。

查找 gnus 的源代码,我想出了这个函数。但是,在阅读文档的面部部分后,我不确定如何将面部分配给函数(如果这是正确的做事方式)。

(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))))
4

1 回答 1

1

似乎没有为开箱即用的主题定义面孔。来自http://www.emacswiki.org/emacs/GnusFormatting的这个小片段试图解决这个问题,并且还为空主题和非空主题引入了单独的面孔:

(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)))

该页面还指出,您必须替换my-gnus-topic-empty-facemy-gnus-topic-face使用一些合适的面孔或创建自己的面孔。

于 2013-04-08T10:28:13.427 回答