Commit 15edcbe8 authored by Guilherme Semente's avatar Guilherme Semente 🌱

elfeed: mark entries that are tagged as daily and that are older than 1 day as read

parent d01f4139
......@@ -510,6 +510,14 @@ You may find other key bindings inside use-package statements."
(set (make-local-variable 'semente-eww-readable) t)
(eww-browse-url (elfeed-entry-link elfeed-show-entry)))
(defun semente-elfeed-mark-old-entries-tagged-daily-as-read (entry)
(let ((date (elfeed-entry-date entry))
(before-time (elfeed-time-duration "1 day ago")))
(when (and
(member 'daily (elfeed-entry-tags entry))
(or (< date (- (float-time) before-time))))
(apply #'elfeed-untag entry (list 'unread)))))
(add-hook 'eww-after-render-hook
(lambda ()
(let ((elfeed-entry-buffer (get-buffer "*elfeed-entry*")))
......@@ -518,7 +526,7 @@ You may find other key bindings inside use-package statements."
(eww-readable))))))
:init
(setq-default elfeed-search-filter "@4-weeks-ago -muted +unread ")
(setq-default elfeed-search-filter "@4-weeks-ago +unread ")
:config
;; see elfeed-org below
......@@ -532,9 +540,7 @@ You may find other key bindings inside use-package statements."
(add-hook 'elfeed-new-entry-hook
(elfeed-make-tagger :before "4 weeks ago" :remove 'unread))
;; mark some feed entries older than 1 days as read
(add-hook 'elfeed-new-entry-hook
(elfeed-make-tagger :feed-url "example\.net" :before "1 days ago" :remove 'unread)))
(add-hook 'elfeed-new-entry-hook 'semente-elfeed-mark-old-entries-tagged-daily-as-read))
(use-package elfeed-org
:ensure t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment