help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regexp in nnmail-split-methods (was Re: cleaning up a big regexp)


From: Tory S. Anderson
Subject: Regexp in nnmail-split-methods (was Re: cleaning up a big regexp)
Date: Tue, 16 Sep 2014 07:05:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Okay; I've run into one more problem that is probabably (hopefully) a simple 
fix. Running the following code, I get a nice regexp in my "my-bulk-from" var. 
However, if I simply set that var as the criteria for "mail.bulk" splitting, 
all my split-methods break and all my mail ends up in my main inbox. If, on the 
other hand, I simply paste the value of that variable (rather than referencing 
the variable), it works as expected. I expect I'm missing a quote or something; 
more importantly, I'm missing some understanding. 

Why does `("mail.bulk" my-bulk-from)` fail but `("mail.bulk" "BIG REGEXP")` 
work, when the value of my-bulk-from is BIG REGEXP?



(setq my-gnus-bulk-from-address-list '("@maillist.codeproject.com"
                                      "@papajohns-specials.com"
                                      "@qomail.quikorder.com"
                                      "@linkedin.com"
                                      "@facebookmail.com"
                                      "@plus.google.com"
                                      "@twitter.com"
                                      "@youtube.com"
                                      "@linguistlist.org"
                                      "@sportsauthority.com")) ;; list of 
bulkmail addresses
(setq my-bulk-from (concat "^From:.*" (regexp-opt 
my-gnus-bulk-from-address-list)))

(setq nnmail-split-methods
;       '(("mail.bulk" my-bulk-from) ;; breaks my split-methods
         ("mail.bulk" 
"^From:.*\\(?:@\\(?:facebookmail\\.com\\|lin\\(?:guistlist\\.org\\|kedin\\.com\\)\\|\\(?:maillist\\.codeproject\\|p\\(?:apajohns-specials\\|lus\\.google\\)\\|qomail\\.quikorder\\|sportsauthority\\|twitter\\|youtube\\)\\.com\\)\\)")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]