1
0
Fork 0

[oni-elfeed] Fix tagger that removes duplicates of Planet Emacslife

First: the match needs to be any entry that does match the names of the people
whos blogs I already follow.

Second: The search regular expression can't contain spaces. It seems to be the
same as any search query. So when a regular expression contains a space it's
considered two different search terms. This doesn't work when we're searching
for one option with a space in it (“Irreal” or “Sacha Chua” or “Andrea”) since
the syntax for the regular expression gets all messed up. Quickest workaround is
to match any whitespace instead.
This commit is contained in:
Tom Willemse 2023-04-11 20:09:32 -07:00
parent 9c1ef54e74
commit f460c3a19f

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2023.0401.234314 ;; Version: 2023.0411.200412
;; Package-Requires: (elfeed olivetti) ;; Package-Requires: (elfeed olivetti)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -106,13 +106,16 @@
;;; Mark any post from Planet Emacslife read if I also follow the originating ;;; Mark any post from Planet Emacslife read if I also follow the originating
;;; blog. This way I won't have so many duplicates. ;;; blog. This way I won't have so many duplicates.
(add-hook 'elfeed-new-entry-hook (defvar oni-elfeed-duplicate-tagger
(elfeed-make-tagger :feed-url (rx "planet.emacslife.com") (elfeed-make-tagger :feed-url (rx "planet.emacslife.com")
:entry-title `(not ,(rx bos (or "Irreal" :entry-title (rx bos (or "Irreal"
"Sacha Chua" (seq "Sacha" whitespace "Chua")
"Andrea") "Andrea")
":")) ":")
:remove 'unread)) :remove 'unread)
"Tagger for elfeed that marks certain posts as read for Emacslife.")
(add-hook 'elfeed-new-entry-hook oni-elfeed-duplicate-tagger)
(add-hook 'elfeed-show-mode-hook #'oni-elfeed-enable-olivetti-mode) (add-hook 'elfeed-show-mode-hook #'oni-elfeed-enable-olivetti-mode)