From 70b9039c94ba9b7d6e803cfc4fe406ef55c77ca8 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 6 May 2021 09:55:54 -0500 Subject: Change subscription method to use a file To set up elsewhere: 1. Delete .emacs.d/var/gnus 2. Start gnus 3. Run gnus/import-feed-list 4. Profit??? I had to also delete all the emails in Emacs-Cloud on IMAP too, so it wasn't what I'd call perfect. But ... it's good enough, for now. I really wish Gnus was more programmable, tbh. --- gnus.el | 62 +++++++++++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 45 deletions(-) (limited to 'gnus.el') diff --git a/gnus.el b/gnus.el index 2ea42ed..3701c70 100644 --- a/gnus.el +++ b/gnus.el @@ -140,48 +140,20 @@ bbdb-offer-save 1 bbdb-update-records-p t)) -;;; Gnus subscriptions -(setq gnus-options-subscribe (rx (or ;; all alternatives go under this - (seq string-start - "nnimap+fastmail.com:" - (or ;; folders in Fastmail - "INBOX"))) - (seq string-start - "nntp+news.tilde.club:" - (or ;; news groups in tilde.club - (seq "local." - (or "general")) - (seq "tilde." - (or "art" - "club" - "cosmic" - "food+drink" - "gopher" - "meta" - "poetry" - "services")))))) - -(setq gnus-options-not-subscribe (rx (or ;; all alternatives go under this - (seq string-start - "nnimap+fastmail.com:" - (or ;; folders in Fastmail - "Archive" - "Bulk" - "DeltaChat" - "Gmail" - "Pam" - "Spam" - "Trash" - "blag" - "notes")) - (seq string-start - "nntp+news.tilde.club:" - (or ;; news groups in tilde.club - (seq "tilde." - (or "black" - "javascript" - "nsfw" - "php" - "pink" - "python" - "your"))))))) +;;; Functions +;; see https://wpc.io/blog/posts/bulk-import-rss-feeds-to-gnus-via-gwene.html +(defun gnus/slurp (file) + "Read FILE into a string." + (with-temp-buffer + (insert-file-contents file) + (buffer-substring-no-properties + (point-min) + (point-max)))) + +(defun gnus/import-feed-list (path) + "Import list of NNTP feeds from file at PATH." + (interactive "F") + (let ((feeds (split-string (gnus/slurp path) "\n" t))) + (cl-loop for feed in feeds + do (with-message (format "Subscribing to %s" feed) + (gnus-subscribe-group feed))))) -- cgit 1.4.1-21-gabe81