dot/gnus-local.el.distorted: Change how `odin' data is collected.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 24 Apr 2020 23:01:08 +0000 (00:01 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 24 Apr 2020 23:06:41 +0000 (00:06 +0100)
Rename the function, and change it so that it updates a variable rather
than just returns the result.  This will make it easier to produce other
kinds of reports later.

dot/gnus-local.el.distorted

index a6cf56d..ed6f0aa 100644 (file)
          "=" "\\(" "\\S-+" "\\)"       ; mailbox tag
          "\\(" "$" "\\|" "\\s-" "\\)"))
 
-(defun mdw-odin-splits ()
+(defvar mdw-odin-splits nil)
+
+(defun mdw-update-odin-info ()
   (let ((list nil))
     (with-temp-buffer
       (call-process "ssh" nil t nil
                       ,(format "crap.%s" tag))
                  list)))
        (forward-line)))
-    (nreverse list)))
+    (setq mdw-odin-splits (nreverse list))))
+(mdw-update-odin-info)
 
 ;; The actual splitting rules.
 (setq nnmail-split-fancy
          (to "\\<mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
 
          (to "\\(markw\\|mdw\\|mw\\)@odin\\.gg" "mail.misc")
-         ,@(mdw-odin-splits)
+         ,@mdw-odin-splits
          (to "\\([a-z0-9]+\\)@odin\\.gg" "crap.odin-misc")
 
          ;; Regular nags.