0

To avoid missing on important news, I am trying to highlight Elfeed entries containing specific words in their titles:

(add-hook 'elfeed-new-entry-hook
      (elfeed-make-tagger :entry-title '("Blade Runner" "Daria"
                                         "Nendoroid" "Twin Peaks")
                          :add 'hearty))

(defface elfeed-face-tag-hearties
  '((t :foreground "#ff0084"))
  "Highlight my favorite things!")

(push '(hearty elfeed-face-tag-hearties)
      elfeed-search-face-alist)

All entries end up being highlighted, even though they do not contain any of the given keywords.

If I add a new hook for each keyword, however, it then works as intended:

(add-hook 'elfeed-new-entry-hook
      (elfeed-make-tagger :entry-title "Blade Runner"
                          :add 'hearty))

(add-hook 'elfeed-new-entry-hook
      (elfeed-make-tagger :entry-title "Daria"
                          :add 'hearty))

(add-hook 'elfeed-new-entry-hook
      (elfeed-make-tagger :entry-title "Nendoroid"
                          :add 'hearty))

(add-hook 'elfeed-new-entry-hook
      (elfeed-make-tagger :entry-title "Twin Peaks"
                          :add 'hearty))

(defface elfeed-face-tag-hearties
  '((t :foreground "#ff0084"))
  "Highlight my favorite things!")

(push '(hearty elfeed-face-tag-hearties)
      elfeed-search-face-alist)

Would you please tell me if there is a way to achieve this more elegantly, i.e. with a single hook or otherwise?

Your help would be much appreciated! Thank you :)

Carapuce
  • 57
  • 4

0 Answers0