Subject: Re: bug#12375: Broken matching of regexps in fancy splitting

From: Sven Joachim <[email-masked]>
Date: Mon, 10 Feb 2014 19:21:24 +0100

On 2014-01-31 00:37 +0100, Lars Ingebrigtsen wrote:

> jathd <[email-masked]> 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 <[email-masked]>
`----

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