Setting to-list group parameter automatically manually
Tim Landscheidt <[email protected]> Sat, 05 Jul 2025 12:31:28 +0000
| Newsgroups | gmane.emacs.gnus.general |
|---|---|
| Organization | https://www.tim-landscheidt.de/ |
| Message-ID | <[email protected]> |
Hi, as having Gmane send mails on my behalf may fail and going through relevant groups and setting the to-list group para- meter manually prior to posting/replying collides with my laziness, I have the following code (GPL3) in my ~/.emacs: | (defcustom tl-check-to-list-setting-groups "gmane" "Regular expression to match on." :type 'regexp) | (defun tl-check-to-list-setting nil | (if (and | (string-match tl-check-to-list-setting-groups gnus-newsgroup-name) | (not (gnus-group-get-parameter gnus-newsgroup-name 'to-list))) | (let | ((list-post-in-article (with-current-buffer gnus-original-article-buffer | (gnus-fetch-field "list-post")))) | (if list-post-in-article | (ignore-error minibuffer-quit | (let ((new-to-list (replace-regexp-in-string "<mailto:\\([^>]*\\)>" "\\1" (read-string "to-list value: " | list-post-in-article) t))) | (gnus-group-set-parameter gnus-newsgroup-name 'to-list new-to-list) | (gnus-mailing-list-mode 1))))))) | (add-hook 'gnus-select-article-hook 'tl-check-to-list-setting) This will prompt me, if I'm in a Gmane group, the to-list group parameter is not set, and the selected article has a "List-Post" header, with a suggested to-list setting and either set it, or, if I quit with C-g, not set it. This will trigger repeatedly for every article, which is fine for me. (The "List-Post" header needs to be manually checked as it can be Gmane-encrypted or refer to another mailing list in case of crossposts.) I intend to rewrite the code and put it into a package pri- marily for my local use (I have grown fond of them), but on the other hand, this may be interesting for all Gnus users, perhaps with a default of disabled. Any opinions? Tim