summary refs log tree commit diff stats
path: root/gnus.el
diff options
context:
space:
mode:
authorCase Duckworth2021-05-06 09:55:54 -0500
committerCase Duckworth2021-05-06 09:55:54 -0500
commit70b9039c94ba9b7d6e803cfc4fe406ef55c77ca8 (patch)
treea783ecb5669118b71dd5696f908628fa270fc6dd /gnus.el
parentFile stuff ... but in init.el (diff)
downloademacs-70b9039c94ba9b7d6e803cfc4fe406ef55c77ca8.tar.gz
emacs-70b9039c94ba9b7d6e803cfc4fe406ef55c77ca8.zip
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.
Diffstat (limited to 'gnus.el')
-rw-r--r--gnus.el62
1 files changed, 17 insertions, 45 deletions
diff --git a/gnus.el b/gnus.el index 2ea42ed..3701c70 100644 --- a/gnus.el +++ b/gnus.el
@@ -140,48 +140,20 @@
140 bbdb-offer-save 1 140 bbdb-offer-save 1
141 bbdb-update-records-p t)) 141 bbdb-update-records-p t))
142 142
143;;; Gnus subscriptions 143;;; Functions
144(setq gnus-options-subscribe (rx (or ;; all alternatives go under this 144;; see https://wpc.io/blog/posts/bulk-import-rss-feeds-to-gnus-via-gwene.html
145 (seq string-start 145(defun gnus/slurp (file)
146 "nnimap+fastmail.com:" 146 "Read FILE into a string."
147 (or ;; folders in Fastmail 147 (with-temp-buffer
148 "INBOX"))) 148 (insert-file-contents file)
149 (seq string-start 149 (buffer-substring-no-properties
150 "nntp+news.tilde.club:" 150 (point-min)
151 (or ;; news groups in tilde.club 151 (point-max))))
152 (seq "local." 152
153 (or "general")) 153(defun gnus/import-feed-list (path)
154 (seq "tilde." 154 "Import list of NNTP feeds from file at PATH."
155 (or "art" 155 (interactive "F")
156 "club" 156 (let ((feeds (split-string (gnus/slurp path) "\n" t)))
157 "cosmic" 157 (cl-loop for feed in feeds
158 "food+drink" 158 do (with-message (format "Subscribing to %s" feed)
159 "gopher" 159 (gnus-subscribe-group feed)))))
160 "meta"
161 "poetry"
162 "services"))))))
163
164(setq gnus-options-not-subscribe (rx (or ;; all alternatives go under this
165 (seq string-start
166 "nnimap+fastmail.com:"
167 (or ;; folders in Fastmail
168 "Archive"
169 "Bulk"
170 "DeltaChat"
171 "Gmail"
172 "Pam"
173 "Spam"
174 "Trash"
175 "blag"
176 "notes"))
177 (seq string-start
178 "nntp+news.tilde.club:"
179 (or ;; news groups in tilde.club
180 (seq "tilde."
181 (or "black"
182 "javascript"
183 "nsfw"
184 "php"
185 "pink"
186 "python"
187 "your")))))))