From ad68b760761bac3ee1fcf88d871c00fb92796dac Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Mon, 1 Jul 2024 23:08:13 +0200 Subject: [PATCH] Add predicate to prune entries from removed feeds --- elfeed-prune.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/elfeed-prune.el b/elfeed-prune.el index a547143..8048841 100644 --- a/elfeed-prune.el +++ b/elfeed-prune.el @@ -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.