dot/gnus-local.el.distorted (gnus-posting-styles): Set address better.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2015 19:15:23 +0000 (19:15 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 11 May 2016 01:08:22 +0000 (02:08 +0100)
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.

dot/gnus-local.el.distorted

index e753bdf..1db8e95 100644 (file)
 
 ;; 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