From: Mark Wooding Date: Tue, 15 Dec 2015 19:15:23 +0000 (+0000) Subject: dot/gnus-local.el.distorted (gnus-posting-styles): Set address better. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/63bc8fd4fe34dc46e1dfc3dfa3c7bbd18788b8e2 dot/gnus-local.el.distorted (gnus-posting-styles): Set address better. Rely on the match data being preserved from matching the group name to when I set the header value. This simplifies the logic quite a bit. --- diff --git a/dot/gnus-local.el.distorted b/dot/gnus-local.el.distorted index e753bdf..1db8e95 100644 --- a/dot/gnus-local.el.distorted +++ b/dot/gnus-local.el.distorted @@ -75,12 +75,10 @@ ;; Mail sent to `mdw-nospam-THING' should appear to come from this address. (setq gnus-posting-styles - '(((and (string-match "^nnimap\\+distorted:crap\\.\\(.*\\)$" - gnus-newsgroup-name) - (setq mdw-from-address - (replace-match "mdw-nospam-\\1@distorted.org.uk" - nil nil gnus-newsgroup-name))) - ("From" mdw-from-address)))) + '(("^nnimap\\+distorted:crap\\." + (address (concat "mdw-nospam-" + (substring gnus-newsgroup-name (match-end 0)) + "@distorted.org.uk"))))) ;; The actual splitting rules. (setq nnmail-split-fancy