Easy command to unsubscribe and delete all on disk/db
Awesome program, btw.
I subscribed to a bunch of feeds when I was setting up that I discovered I am no longer interested in as soon as they loaded. I'd like an easy "unsubscribe-from-the-feed-that-brought-me-this-and-delete-from-disk" macro, if such a thing can be baked in.
Unfortunately the way elfeed-feeds is configured, Elfeed doesn't really have a reliable way to manipulate the feed listing. While Elfeed opportunistically uses the customization system to persist this list, advanced users generaly construct/manage their list directly — an explicit setq, via elfeed-org, etc. — all out of reach of Elfeed. This means there's no generic solution to do exactly what you want.
Fortunately it's easy to do for your own usage patterns. The simplest is to display the feed URL for the entry currently under point:
(defun my-display-current-entry-feed ()
(interactive)
(let ((entry (elfeed-search-selected t)))
(when entry
(let ((feed (elfeed-entry-feed entry)))
(message "%s" (elfeed-feed-url feed))))))
Use M-x my-display-current-entry-feed, then remove the shown URL from your config. If you're relying on customization and changes to elfeed-feeds persist automatically, then you can modify it a bit to get close to what you want:
(defun my-unsubscribe-current-feed ()
(interactive)
(let ((entry (elfeed-search-selected t)))
(when entry
(let* ((feed (elfeed-entry-feed entry))
(url (elfeed-feed-url feed)))
(setf elfeed-feeds
(cl-remove url elfeed-feeds
:test #'equal
:key (lambda (e) (if (listp e) (car e) e)))))
(customize-save-variable 'elfeed-feeds elfeed-feeds))))
@skeeto how can I clear the whole database and update to rebuild it?