From unknown Sat Aug 16 21:11:46 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12375 <12375@debbugs.gnu.org> To: bug#12375 <12375@debbugs.gnu.org> Subject: Status: Broken matching of regexps in fancy splitting Reply-To: bug#12375 <12375@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:11:46 +0000 retitle 12375 Broken matching of regexps in fancy splitting reassign 12375 emacs,gnus submitter 12375 jathd severity 12375 normal tag 12375 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 07 01:30:08 2012 Received: (at submit) by debbugs.gnu.org; 7 Sep 2012 05:30:08 +0000 Received: from localhost ([127.0.0.1]:45265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T9r8p-0004WZ-75 for submit@debbugs.gnu.org; Fri, 07 Sep 2012 01:30:08 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:52607) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T9pSI-0007uN-7f for submit@debbugs.gnu.org; Thu, 06 Sep 2012 23:42:07 -0400 Received: by wibhr14 with SMTP id hr14so5924813wib.15 for ; Thu, 06 Sep 2012 20:41:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:x-debbugs-version:x-debbugs-package:date:message-id :user-agent:mime-version:content-type; bh=Jq8kWWX63u9uCWKP1TKoMvRtTFNMtsomGMcZCwOzGDY=; b=yyK4V1o+VBZrC0ded7Gl+JvGi52AtIRkjPb9XPGCkTelODpHy+I0IjzTaEnbkN2bUB jtMgKybOgPRVBzF0N6aSWjjscx4cW5Jrl8Hn8jNZ5KBM63P14dP+eWs4QB/snqG6yrtb hukWzSanlYuVy5Ua+cQIGlCiBXjafpEuIpEXae0Tbz4XAopZJrBGl+yKedgkD6Ul/Slc WZJ7hUD2UGUwf0M7Bmk2rmtPSZGiXOWsvMTvbJmj0tXWwoQhTgUT3vy/8ZhGiSC/Oh0s wG1HI6clN3yp68u3bRA7Ie5tVs1gMakMbrWqLmm0uINXk70YeUGaxInlj4BRctToFgVi j7iQ== Received: by 10.217.1.79 with SMTP id m57mr2221961wes.121.1346989309884; Thu, 06 Sep 2012 20:41:49 -0700 (PDT) Received: from mbk.local (mon69-5-88-169-253-165.fbx.proxad.net. [88.169.253.165]) by mx.google.com with ESMTPS id o2sm10755892wiz.11.2012.09.06.20.41.47 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 20:41:48 -0700 (PDT) From: jathd To: submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys) Subject: Broken matching of regexps in fancy splitting X-Debbugs-Version: 5.130006 X-Debbugs-Package: gnus Date: Fri, 07 Sep 2012 05:41:45 +0200 Message-ID: User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 07 Sep 2012 01:30:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Hi. I'm not sure if this counts as a bug, but it's certainly an unexpected behaviour (to me) to which I have found no reference in the manual. The situation: * In .gnus.el, specify splitting with (setq nnmail-split-methods 'nnmail-split-fancy) (setq nnmail-split-fancy '(to "\\(\\w+\\)-devel@.*" "list.devel.\\1")) * Visit a message whose only relevant header (relative to the "to" abbreviation) is To: Batteries-devel * Press B q and read the message in the minibuffer. Current message: This message would go to list.devel.s Expected message: This message would go to list.devel.batteries I believe the problem comes from the way the regexp value I gave (the VALUE field in the split) is matched against the contents of the header, as defined in the function nnmail-split-it in nnmail.el. Once the interesting bit of the header has been found, the match is done with re-search-backward, which explains why the "\\w+" bit only matches the last letter of "batteries". This conflicts with what is usually meant by a regexp matching a string. I know I was expecting the match to be done as if by (string-match regexp relevant-header-part). Here's a simple patch that changes re-search-backward to re-search-forward: ======================================================================== --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1463,13 +1463,13 @@ See the documentation for the variable `nnmail-split-fancy' for details." (setq split-rest nil) (setq split-rest (cddr split-rest)))) (when split-rest - (goto-char end) + (goto-char start-of-value) (let ((value (nth 1 split))) (if (symbolp value) (setq value (cdr (assq value nnmail-split-abbrev-alist)))) ;; Someone might want to do a \N sub on this match, so get the ;; correct match positions. - (re-search-backward value start-of-value)) + (re-search-forward value end)) (dolist (sp (nnmail-split-it (car split-rest))) (unless (member sp split-result) (push sp split-result)))))) ======================================================================== This produces the expected message, and I don't think it should break anything. [As a side note: is there a particular reason why the file nnmail.el uses re-search-backward everywhere and not re-search-forward, or does it come down to taste?] Ma Gnus v0.6 GNU Emacs 24.2.50.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36) of 2012-09-07 on mbk.local 200 news-1.free.fr (5-1) NNRP Service Ready - newsmaster@proxad.net (posting ok) 500 What? -- jathd From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 25 10:14:06 2012 Received: (at 12375) by debbugs.gnu.org; 25 Dec 2012 15:14:06 +0000 Received: from localhost ([127.0.0.1]:59309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnWCf-0001uK-UL for submit@debbugs.gnu.org; Tue, 25 Dec 2012 10:14:06 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:36904) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnWCZ-0001tm-7U for 12375@debbugs.gnu.org; Tue, 25 Dec 2012 10:14:00 -0500 Received: from ip-90-20-179-93.dialup.ice.net ([93.179.20.90] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TnWBm-0002Qn-JB; Tue, 25 Dec 2012 16:13:07 +0100 From: Lars Ingebrigtsen To: jathd Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: X-Now-Playing: Winston Tong's _Theoretically Chinese_ Date: Tue, 25 Dec 2012 16:13:03 +0100 In-Reply-To: (jathd's message of "Fri, 07 Sep 2012 05:41:45 +0200") Message-ID: <87zk1288sg.fsf@gnus.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1TnWBm-0002Qn-JB X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1357053188.41984@rgbS1G+M4jTqAXgr1kC0UQ X-Spam-Status: No X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12375 Cc: 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.0 (/) jathd writes: > I'm not sure if this counts as a bug, but it's certainly an unexpected > behaviour (to me) to which I have found no reference in the manual. > > The situation: > > * In .gnus.el, specify splitting with > > (setq nnmail-split-methods 'nnmail-split-fancy) > (setq nnmail-split-fancy > '(to "\\(\\w+\\)-devel@.*" "list.devel.\\1")) > > * Visit a message whose only relevant header (relative to the "to" > abbreviation) is > > To: Batteries-devel > > * Press B q and read the message in the minibuffer. > > Current message: This message would go to list.devel.s > Expected message: This message would go to list.devel.batteries > > I believe the problem comes from the way the regexp value I gave (the > VALUE field in the split) is matched against the contents of the header, > as defined in the function nnmail-split-it in nnmail.el. Once the > interesting bit of the header has been found, the match is done with > re-search-backward, which explains why the "\\w+" bit only matches the > last letter of "batteries". Do you have `nnmail-split-fancy-match-partial-words' set? If not, the splitting machinery will put a \\< in front of the regexp, leading to "batteries" being matched. -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Lars Magne Ingebrigtsen From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 02 14:03:39 2013 Received: (at 12375) by debbugs.gnu.org; 2 Feb 2013 19:03:39 +0000 Received: from localhost ([127.0.0.1]:33196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1iND-0001qy-Rs for submit@debbugs.gnu.org; Sat, 02 Feb 2013 14:03:39 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:35154) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U1iN7-0001qg-QX for 12375@debbugs.gnu.org; Sat, 02 Feb 2013 14:03:34 -0500 Received: by mail-wi0-f174.google.com with SMTP id hi8so1186032wib.13 for <12375@debbugs.gnu.org>; Sat, 02 Feb 2013 11:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:in-reply-to:references:user-agent :date:message-id:mime-version:content-type; bh=Swul4IvY/i+BzmhvYOZNECxhPipqSgkD5+/euJAW7n0=; b=M+jcbb0gynEiT8onU0PBCy0NArut5WcDH/sjBiaoEvcajN8Elb2uoA8wqtEGgkFQFr SdYvA5Kd9LtDbeWddTea50ZwCfrMWF1No7sL5H0JBQdGiJKFvTENYw6UDGMg9ZC9QJsK hAeynLDQlGO08ojAJalosipPJvsP4C8E2G3efiMuNxH9sp1My/qHCQvkKLNjzIyQALh8 U+Tx7XPlGKrzcjyil9DuqXmEOSO1mIpD4Xvza9G69DrgRLAHgKidD7nW7BlPzt/Q9oR7 0APCOTv0bBWD2RKzV1yfeCN4hTSA9uHF+oFWRba6n4RroEaPKj6PUIfs5D0w1fWRFDhC EoEQ== X-Received: by 10.180.99.227 with SMTP id et3mr3439183wib.6.1359831754254; Sat, 02 Feb 2013 11:02:34 -0800 (PST) Received: from mbk (209.132.121.78.rev.sfr.net. [78.121.132.209]) by mx.google.com with ESMTPS id be1sm11523693wib.10.2013.02.02.11.02.32 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 02 Feb 2013 11:02:33 -0800 (PST) From: jathd To: Lars Ingebrigtsen Subject: Re: bug#12375: Broken matching of regexps in fancy splitting In-Reply-To: <87zk1288sg.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Dec 2012 16:13:03 +0100") References: <87zk1288sg.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Date: Sat, 02 Feb 2013 20:02:30 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12375 Cc: 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Lars Ingebrigtsen writes: > Do you have `nnmail-split-fancy-match-partial-words' set? If not, the > splitting machinery will put a \\< in front of the regexp, leading to > "batteries" being matched. I have `nnmail-split-fancy-match-partial-words' set to `nil', and I checked that the splitting process does put a "\\<" in the regexp. The problem is that this regexp is used to decide whether a message follows a rule (in other words, that regexp is matched against the message header), but when extracting the value with which to replace "\\1" in the group name "list.devel.\\1" I gave, it matches a second time with the *original regexp* I gave (and not the whole header this time, it narrows the search to the interesting part of the relevant header field). So this time, it uses the regexp without the "\\<", which explains why it replaces "\\1" with "s" instead of "batteries". So there's a simple workaround: I just put a "\\<" in the regexp in `nnmail-split-fancy', and it works fine. So I don't know if this is a bug or not; the workaround is simple, but I still find the behaviour of the matcher a bit unexpected. Namely, I would expect it to match as if using `(string-match regexp-I-gave contents-of-relevant-header-field)'. Maybe the manual should have a word about this? -- jathd From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 06 13:54:14 2013 Received: (at 12375) by debbugs.gnu.org; 6 Jul 2013 17:54:14 +0000 Received: from localhost ([127.0.0.1]:35151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UvWgX-0005jf-Vz for submit@debbugs.gnu.org; Sat, 06 Jul 2013 13:54:14 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:33826) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UvWgU-0005jM-2N for 12375@debbugs.gnu.org; Sat, 06 Jul 2013 13:54:11 -0400 Received: from 46.157.223.218.tmi.telenormobil.no ([46.157.223.218] helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UvWgI-0003iF-Tk; Sat, 06 Jul 2013 19:53:59 +0200 From: Lars Ingebrigtsen To: jathd Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: <87zk1288sg.fsf@gnus.org> Date: Sat, 06 Jul 2013 19:53:46 +0200 In-Reply-To: (jathd's message of "Sat, 02 Feb 2013 20:02:30 +0100") Message-ID: <87zjtzlglx.fsf@building.gnus.org> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1UvWgI-0003iF-Tk X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1373738039.32141@TRtYhuMYE8IpEayWJCsitA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12375 Cc: 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) jathd writes: > The problem is that this regexp is used to decide whether a message > follows a rule (in other words, that regexp is matched against the > message header), but when extracting the value with which to replace > "\\1" in the group name "list.devel.\\1" I gave, it matches a second > time with the *original regexp* I gave (and not the whole header this > time, it narrows the search to the interesting part of the relevant > header field). So this time, it uses the regexp without the "\\<", which > explains why it replaces "\\1" with "s" instead of "batteries". Hm. Looking at the code, I can't see where it's re-matching against the original regexp. `nnmail-expand-newtext' just uses the result from `match-beginning'/`match-end', which should be the right thing to do. If I've reading the code correctly, which I may not be doing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 11 18:07:15 2013 Received: (at 12375) by debbugs.gnu.org; 11 Aug 2013 22:07:15 +0000 Received: from localhost ([127.0.0.1]:53469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V8dn9-0003Fz-32 for submit@debbugs.gnu.org; Sun, 11 Aug 2013 18:07:15 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:50147) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V8dn4-0003Fh-5I for 12375@debbugs.gnu.org; Sun, 11 Aug 2013 18:07:13 -0400 Received: by mail-wi0-f174.google.com with SMTP id j17so1066935wiw.13 for <12375@debbugs.gnu.org>; Sun, 11 Aug 2013 15:07:04 -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=nBeba1Ca8dwh4nVkEOzsByvP4k192Zo3IPW0tEjpcmk=; b=LkaIPhwgWh69T+N2Lic3Zf3KbuR+MjnjiA8di962E5E6Tp8JBYbtnJc0dIj960UUcD nJkqwm6membmU4lfqij+y5Rd11ZdZ9srAYlnl0Z5SPw8vSJTBKCWxVvB2jqx+YNRmU4Y h1ybnrOgu8MBtA8bo5YvDb3iv3xIjKK/fVDYnqUl3XJ8TsUbVSJ2kv3wvu+Fs0GbT2fV 5CftC61M8TKUh/bzK8aPqCzsYb5svfjKkeIewA9j2aRodo4PXiE9UBWzmMsRtZVFR8zJ ncTzxFqgSXPLNrQSx1QgVfnzc4Ut60Iud/kAviqgR0f+F6xQ/hU4aJDzNlPPAQ41AIUf 4HXw== X-Received: by 10.180.210.231 with SMTP id mx7mr5049915wic.5.1376258824419; Sun, 11 Aug 2013 15:07:04 -0700 (PDT) Received: from mbk.local (fr141-3-78-229-169-69.fbx.proxad.net. [78.229.169.69]) by mx.google.com with ESMTPSA id o10sm13193937wiz.5.2013.08.11.15.07.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 11 Aug 2013 15:07:03 -0700 (PDT) From: jathd To: Lars Ingebrigtsen Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: <87zk1288sg.fsf@gnus.org> <87zjtzlglx.fsf@building.gnus.org> Date: Mon, 12 Aug 2013 00:07:00 +0200 In-Reply-To: <87zjtzlglx.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Sat, 06 Jul 2013 19:53:46 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 12375 Cc: 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Lars Ingebrigtsen writes: > Hm. Looking at the code, I can't see where it's re-matching against the > original regexp. It's around line 1470: (let ((value (nth 1 split))) (if (symbolp value) (setq value (cdr (assq value nnmail-split-abbrev-alist)))) ;; Someone might want to do a \N sub on this match, so get the ;; correct match positions. (re-search-backward value start-of-value)) The `value' is the regexp I specified in `nnmail-split-fancy'. Before that, to see whether a header matches, the function does (re-search-backward (cdr cached-pair) nil t) where (cdr cached-pair) is a regexp it constructed the first time around. Since it prepended a "\\<" to *that* regexp, the header is correctly identified; but it didn't prepend anything to `value', so the extraction goes wrong. -- jathd From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 18:38:57 2014 Received: (at 12375) by debbugs.gnu.org; 30 Jan 2014 23:38:57 +0000 Received: from localhost ([127.0.0.1]:41892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W91CD-0003bU-6A for submit@debbugs.gnu.org; Thu, 30 Jan 2014 18:38:57 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:50358) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W91C8-0003bI-Ja for 12375@debbugs.gnu.org; Thu, 30 Jan 2014 18:38:54 -0500 Received: from [204.14.154.233] (helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W91Bt-0002E2-R0; Fri, 31 Jan 2014 00:38:38 +0100 From: Lars Ingebrigtsen To: jathd Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: <87zk1288sg.fsf@gnus.org> <87zjtzlglx.fsf@building.gnus.org> Date: Thu, 30 Jan 2014 15:37:49 -0800 In-Reply-To: (jathd's message of "Mon, 12 Aug 2013 00:07:00 +0200") Message-ID: <87iot1avn6.fsf@building.gnus.org> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1W91Bt-0002E2-R0 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1391729918.6735@CmyrWBNmBOXR0XGRvRozlg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12375 Cc: 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) jathd writes: > The `value' is the regexp I specified in `nnmail-split-fancy'. Before > that, to see whether a header matches, the function does > > (re-search-backward (cdr cached-pair) nil t) > > where (cdr cached-pair) is a regexp it constructed the first time > around. Since it prepended a "\\<" to *that* regexp, the header is > correctly identified; but it didn't prepend anything to `value', so the > extraction goes wrong. Aha. I've now rewritten that function to save the match data explicitly after doing the first match so that we don't have to redo the search. It should be faster, too. Does this fix the problem for you? It's in git Gnus, but should be in bzr Emacs soon... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 10 13:21:31 2014 Received: (at 12375) by debbugs.gnu.org; 10 Feb 2014 18:21:31 +0000 Received: from localhost ([127.0.0.1]:41666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCvU2-0006vu-V1 for submit@debbugs.gnu.org; Mon, 10 Feb 2014 13:21:31 -0500 Received: from mout.gmx.net ([212.227.17.22]:50889) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WCvU0-0006vg-Az for 12375@debbugs.gnu.org; Mon, 10 Feb 2014 13:21:29 -0500 Received: from localhost.localdomain ([79.198.10.206]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MQ2zr-1W8mt02cy3-005EJ2 for <12375@debbugs.gnu.org>; Mon, 10 Feb 2014 19:21:22 +0100 Received: by localhost.localdomain (Postfix, from userid 1000) id 6442D3F4EA; Mon, 10 Feb 2014 19:21:24 +0100 (CET) From: Sven Joachim To: Lars Ingebrigtsen Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: <87zk1288sg.fsf@gnus.org> <87zjtzlglx.fsf@building.gnus.org> <87iot1avn6.fsf@building.gnus.org> Date: Mon, 10 Feb 2014 19:21:24 +0100 In-Reply-To: <87iot1avn6.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Thu, 30 Jan 2014 15:37:49 -0800") Message-ID: <87txc6suaj.fsf@turtle.gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Z1HC5TUNBrZ+ruFruJ6OJsPThPLmaYmFpMidsZU0yhqckkKeCcs Q+OtaDGpfPWhhEV/2ELiRBnELlDQYGbwYHCeLyb99hRv0Hh+Wnr6wzzZ5yms/RyTqeDBtLX yrTZqEb13vJsn/wgaHdCqT5CH/8rdWMbGJjWGErp0SLIvG3u15DVWpXt7qo2954maqG+PtF MiBsta+20vWZI8SQ86DdA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12375 Cc: jathd , 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 2014-01-31 00:37 +0100, Lars Ingebrigtsen wrote: > jathd writes: > >> The `value' is the regexp I specified in `nnmail-split-fancy'. Before >> that, to see whether a header matches, the function does >> >> (re-search-backward (cdr cached-pair) nil t) >> >> where (cdr cached-pair) is a regexp it constructed the first time >> around. Since it prepended a "\\<" to *that* regexp, the header is >> correctly identified; but it didn't prepend anything to `value', so the >> extraction goes wrong. > > Aha. > > I've now rewritten that function to save the match data explicitly after > doing the first match so that we don't have to redo the search. It > should be faster, too. > > Does this fix the problem for you? It's in git Gnus, but should be in > bzr Emacs soon... It seems this happened recently, and it apparently broke something for me: I'm subscribed to Debian bug 715194[1], and messages coming from that bug have the following header line: ,---- | Resent-CC: Debian OpenSSH Maintainers `---- Now I'm using the following split rule, copied from the Gnus manual: ,---- | (to "debian-\\b\\(\\w+\\)@lists.debian.org" "mail.debian.\\1") `---- With that rule, messages to the above bug used to appear under mail.debian.ssh, but since my latest Emacs upgrade yesterday, they show up under "mail.debian.resent-cc: debian openssh maintainers <" instead. Huh? Cheers, Sven 1. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715194 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 12 00:53:53 2014 Received: (at 12375) by debbugs.gnu.org; 12 Feb 2014 05:53:54 +0000 Received: from localhost ([127.0.0.1]:48171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDSld-0001xP-IV for submit@debbugs.gnu.org; Wed, 12 Feb 2014 00:53:53 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:60979) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WDSlZ-0001xD-By for 12375@debbugs.gnu.org; Wed, 12 Feb 2014 00:53:50 -0500 Received: from [204.14.154.233] (helo=building.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1WDSlF-00016z-3i; Wed, 12 Feb 2014 06:53:29 +0100 From: Lars Ingebrigtsen To: Sven Joachim Subject: Re: bug#12375: Broken matching of regexps in fancy splitting References: <87zk1288sg.fsf@gnus.org> <87zjtzlglx.fsf@building.gnus.org> <87iot1avn6.fsf@building.gnus.org> <87txc6suaj.fsf@turtle.gmx.de> Date: Tue, 11 Feb 2014 21:52:10 -0800 In-Reply-To: <87txc6suaj.fsf@turtle.gmx.de> (Sven Joachim's message of "Mon, 10 Feb 2014 19:21:24 +0100") Message-ID: <87k3d027zp.fsf@building.gnus.org> User-Agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1WDSlF-00016z-3i X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1392789209.86721@ih4Nlw0IvON6byk8fyBaxQ X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12375 Cc: jathd , 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sven Joachim writes: > With that rule, messages to the above bug used to appear under > mail.debian.ssh, but since my latest Emacs upgrade yesterday, they show > up under "mail.debian.resent-cc: debian openssh maintainers <" instead. > Huh? Oops. Fixed in bzr Emacs now, so it'll be fixed in git Gnus soon. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/ From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 09:50:27 2017 Received: (at control) by debbugs.gnu.org; 25 Jan 2017 14:50:27 +0000 Received: from localhost ([127.0.0.1]:41700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWOu3-0004GF-7c for submit@debbugs.gnu.org; Wed, 25 Jan 2017 09:50:27 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:42275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWOu1-0004G7-Ik for control@debbugs.gnu.org; Wed, 25 Jan 2017 09:50:25 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWOti-0007jT-99 for control@debbugs.gnu.org; Wed, 25 Jan 2017 15:50:24 +0100 Date: Wed, 25 Jan 2017 15:50:00 +0100 Message-Id: <87r33r5h47.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12375 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) reassign 12375 emacs,gnus From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 10:03:29 2017 Received: (at 12375) by debbugs.gnu.org; 25 Jan 2017 15:03:29 +0000 Received: from localhost ([127.0.0.1]:42919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWP6d-0006Ze-Ck for submit@debbugs.gnu.org; Wed, 25 Jan 2017 10:03:28 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:42642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWP6Y-0006ZT-8c for 12375@debbugs.gnu.org; Wed, 25 Jan 2017 10:03:25 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWP6Q-0002gk-Jc; Wed, 25 Jan 2017 16:03:21 +0100 From: Lars Ingebrigtsen To: Sven Joachim Subject: Re: bug#12375: Broken matching of regexps in fancy splitting In-Reply-To: <87k3d027zp.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Tue, 11 Feb 2014 21:52:10 -0800") Date: Wed, 25 Jan 2017 15:50:56 +0100 Message-ID: <87k29j5h2n.fsf@gnus.org> References: <87zk1288sg.fsf@gnus.org> <87zjtzlglx.fsf@building.gnus.org> <87iot1avn6.fsf@building.gnus.org> <87txc6suaj.fsf@turtle.gmx.de> <87k3d027zp.fsf@building.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 12375 Cc: jathd , 12375@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Lars Ingebrigtsen writes: > Sven Joachim writes: > >> With that rule, messages to the above bug used to appear under >> mail.debian.ssh, but since my latest Emacs upgrade yesterday, they show >> up under "mail.debian.resent-cc: debian openssh maintainers <" instead. >> Huh? > > Oops. Fixed in bzr Emacs now, so it'll be fixed in git Gnus soon. I guess this can be closed now... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 10:03:33 2017 Received: (at control) by debbugs.gnu.org; 25 Jan 2017 15:03:33 +0000 Received: from localhost ([127.0.0.1]:42924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWP6i-0006a8-Og for submit@debbugs.gnu.org; Wed, 25 Jan 2017 10:03:33 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:42650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWP6f-0006Zh-MJ for control@debbugs.gnu.org; Wed, 25 Jan 2017 10:03:29 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWP6d-0003bb-D0 for control@debbugs.gnu.org; Wed, 25 Jan 2017 16:03:29 +0100 From: Lars Ingebrigtsen To: control@debbugs.gnu.org Subject: control message for bug #12375 Message-ID: <87inp35h2j.fsf@totally-fudged-out-message-id> Date: Wed, 25 Jan 2017 16:03:21 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 12375 fixed close 12375 From unknown Sat Aug 16 21:11:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Feb 2017 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator