Add predicate to prune entries from removed feeds

This commit is contained in:
Bram Schoenmakers 2024-07-01 23:08:13 +02:00
parent 564a8d63bf
commit ad68b76076
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

View file

@ -65,7 +65,8 @@ to t you are aware of the risks."
:type 'boolean)
(defcustom elfeed-prune-predicates
(list #'elfeed-prune--entry-too-old-p)
(list #'elfeed-prune--entry-too-old-p
#'elfeed-prune--feed-unlisted-p)
"Entries that match *any* of these predicates are pruned.
Each predicate accepts an entry and a feed object and should
@ -82,6 +83,11 @@ return t when the entry should be kept."
:group 'elfeed-prune
:type 'list)
(defun elfeed-prune--feed-unlisted-p (entry feed)
(not (seq-contains-p (mapcar #'car elfeed-feeds)
(elfeed-feed-url feed)
#'string=)))
(defun elfeed-prune--entry-too-old-p (entry _)
"Return t if the given ENTRY is considered too old.