elfeed 的阅读过的条目如何将其变成其他颜色的字体颜色?
大约是这样子的过程,对多数改face的情况有效:
- 光标放在目标位置(elfeed-search已读条目)上,用
describe-face
查看这是由什么face决定的。(如果开了hl-line-mode, 就关掉,要不结果是hl-line的face):
由此可知是由 elfeed-search-title-face 定义的。
- 改face
(set-face-attribute 'elfeed-search-title-face nil
:foreground "Green"
;; :background "pink"
;; :weight 'bold
)
当然也可以使用:
custom-set-faces
custom-theme-set-faces
set-face-foreground
set-face-background
歪楼,可以修改一下 describe-face 来绕过 hl-line
(defun my-face-at-point ()
"In hl-mode the default `face-at-point' is hl-face forever.
So define a function to get the face after hl-face."
(let ((face (get-text-property (point) 'face)))
(or
(and (face-list-p face) (car face))
(and (symbolp face) face))))
(defun my-describe-face (&rest _ignore)
"Overrite `describe-face'."
(interactive
(list
(read-face-name "Describe face"
(or (my-face-at-point) 'default)
t)))
;; This only needs to change the `interactive` spec, so:
nil)
(eval-after-load "hl-line"
'(advice-add 'describe-face :before #'my-describe-face))
1 个赞
哈哈谢大佬补充,抄走~
学到了~也抄走~
下面是我的设置:我希望在标为已读的条目变成灰色。没有阅读的条目以黑色字体显示。
(use-package elfeed
:ensure t
:defer t
;:commands (elfeed)
;:config
:bind
("C-x w" . elfeed )
:config
(;;set-face-attribute 'elfeed-search-title-face nil
set-face-attribute 'elfeed-search-title-face nil
;:foreground "Green"
:foreground "#B0BEC5"
;; :background "pink"
;; :weight 'bold
)
)
现在的条目的字体都是灰色了。默认开启了hl-line-mode.是不是还其他什么设置?
你把 elfeed-search-unread-title-face
也设置一下看看?我猜unread-title-face 优先级大于通用的 title-face
学到了zsbd