【问题标题】:How to customize face for gnus-group-topic emacs24?如何为 gnus-group-topic emacs24 自定义人脸?
【发布时间】:2013-03-29 23:56:07
【问题描述】:

我正在尝试在 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))))

【问题讨论】:

    标签: emacs emacs24 emacs-faces gnus


    【解决方案1】:

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

    (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 替换为一些合适的面孔或创建自己的面孔。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-14
      • 1970-01-01
      • 1970-01-01
      • 2013-02-10
      • 1970-01-01
      • 2017-05-20
      相关资源
      最近更新 更多