From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: torys.anderson@gmail.com (Tory S. Anderson) Newsgroups: gmane.emacs.help Subject: Regexp in nnmail-split-methods (was Re: cleaning up a big regexp) Date: Tue, 16 Sep 2014 07:05:16 -0400 Message-ID: <87d2avj05v.fsf_-_@gmail.com> References: <87iokpf6v8.fsf@gmx.de> <87a961ulzf.fsf@gmail.com> <87tx49dldt.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410865564 18615 80.91.229.3 (16 Sep 2014 11:06:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Sep 2014 11:06:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 16 13:05:55 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XTqZz-0003JV-GB for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2014 13:05:51 +0200 Original-Received: from localhost ([::1]:37132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTqZy-000244-Gv for geh-help-gnu-emacs@m.gmane.org; Tue, 16 Sep 2014 07:05:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTqZW-00023v-Pv for help-gnu-emacs@gnu.org; Tue, 16 Sep 2014 07:05:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTqZV-0005VK-5T for help-gnu-emacs@gnu.org; Tue, 16 Sep 2014 07:05:22 -0400 Original-Received: from mail-yh0-x234.google.com ([2607:f8b0:4002:c01::234]:42956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTqZV-0005V7-1S for help-gnu-emacs@gnu.org; Tue, 16 Sep 2014 07:05:21 -0400 Original-Received: by mail-yh0-f52.google.com with SMTP id f73so2938337yha.39 for ; Tue, 16 Sep 2014 04:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=hnwUf5IBLtGbPykE3bglrqlnEShAvJqvviaDjl65/lM=; b=wmD1yJr0wcpTCGeZlFdQueO+30lBVNBN2LXvJIrsj7uPnLmiwsINx2rGnlPBvZJI+C SdlEsBYuval6aF4zTg4BD3p6M1cRdfUOa9uYCQaC6y4yItBRmQnV4tpFj03ylBFIi26j px8SedTUm4nXMZ8jBPO5JjzbhnYbop13DzouVT9rqZyY/+/0T19U3+wGLpoXYN/UIvwN cXmOmZYo+Db6PBuLIHEzBJ6tl6jhHUB9u4hYeKZnmgdgdegbAF8rLnXqlxPqvdEiQgiz y5HUr/VjAPJMyQSJkv1CxiVbUTJS/ysqmX4etFbOPEXq/76f58yDIG9lkevZQq2uqOlW wKYw== X-Received: by 10.236.149.134 with SMTP id x6mr25189yhj.149.1410865517419; Tue, 16 Sep 2014 04:05:17 -0700 (PDT) Original-Received: from localhost.localdomain ([2601:0:a000:4a1:ee55:f9ff:feb5:5589]) by mx.google.com with ESMTPSA id t6sm6343884yhg.44.2014.09.16.04.05.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 04:05:16 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 15 Sep 2014 15:00:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c01::234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99947 Archived-At: 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\\)\\)")