From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/9778 Path: main.gmane.org!not-for-mail From: David Moore Newsgroups: gmane.emacs.gnus.general Subject: Re: nnmail-split-it Date: 03 Feb 1997 15:28:08 -0800 Sender: dmoore@sdnp5.ucsd.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035149749 20468 80.91.224.250 (20 Oct 2002 21:35:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:35:49 +0000 (UTC) Return-Path: Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.8.5/8.8.5) with SMTP id PAA10969 for ; Mon, 3 Feb 1997 15:38:54 -0800 Original-Received: from UCSD.EDU (mailbox1.ucsd.edu [132.239.1.53]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Tue, 4 Feb 1997 00:25:32 +0100 Original-Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by UCSD.EDU (8.8.5/8.6.9) with SMTP id PAA04281 for ; Mon, 3 Feb 1997 15:25:21 -0800 (PST) Original-Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4) id PAA28410; Mon, 3 Feb 1997 15:28:09 -0800 Original-To: ding@ifi.uio.no X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L Mail-Copies-To: never In-Reply-To: joda@pdc.kth.se's message of 02 Feb 1997 23:06:30 +0100 Original-Lines: 28 X-Mailer: Gnus v5.4.8/XEmacs 19.15 Xref: main.gmane.org gmane.emacs.gnus.general:9778 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:9778 joda@pdc.kth.se (Johan Danielsson) writes: > Nnmail-split-it is currently using re-search-backward, this fails with > splits like this: > > ("sender" "\\(.*\\)@foo.org" "foo-\\1") > > What will searching forward break? If there are multiple headers which match, it'll get the earlier ones rather than the latter ones. The problem in this case however is the two competing .*'s in the regexp. A better fix is probably just make the innermost regexp-search-backwards into a forwards, not both of them. And a much better fix would be to preparse the message headers, to allow much faster comparisons, as it's really slow currently with lots of split rules. Something like making a list of header names to the start/end points of that header's value in the buffer might be good. Then you just do string-match of the field designator to each thing in the list, and the first one which matches, you apply the value regexp to the buffer limited to the start/end region. -- David Moore | Computer Systems Lab __o UCSD Dept. Computer Science - 0114 | Work: (619) 534-8604 _ \<,_ La Jolla, CA 92093-0114 | Fax: (619) 534-1445 (_)/ (_) | In a cloud bones of steel.