dot/vm: Make `vm-reply-ignored-addresses' patterns match correctly.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 24 May 2020 01:50:31 +0000 (02:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 24 May 2020 01:50:31 +0000 (02:50 +0100)
They're taken from the BBDB patterns, but BBDB only matches the actual
mailbox part of an address, while VM wants to match the entire address
string.  Strip off leading `^' and trailing `$', and wrap `\<...\>'
around instead.

dot/vm

diff --git a/dot/vm b/dot/vm
index 751b107..c982842 100644 (file)
--- a/dot/vm
+++ b/dot/vm
                           "subject:" "date:"
                           "delivered-to:" "return-path:"))
 
-(setq vm-reply-ignored-addresses (cons bbdb-user-mail-names nil))
+(setq vm-reply-ignored-addresses
+      (let ((pat bbdb-user-mail-names))
+       (if (string-prefix-p "^" pat)
+           (setq pat (substring pat 1)))
+       (if (string-suffix-p "$" pat)
+           (setq pat (substring pat 0 (1- (length pat)))))
+       (cons (concat "\\<" pat "\\>") nil)))
 
 (defvar mdw-mailing-lists
   '("hibachi-dealers-members@chiark\\.greenend\\.org\\.uk"))