Gnus development mailing list
 help / color / mirror / Atom feed
* nnmail-split-it
@ 1997-02-02 22:06 Johan Danielsson
  1997-02-03 23:28 ` nnmail-split-it David Moore
  1997-02-04  0:46 ` nnmail-split-it Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 12+ messages in thread
From: Johan Danielsson @ 1997-02-02 22:06 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 176 bytes --]


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?

/Johan


[-- Attachment #2: Type: text/plain, Size: 1387 bytes --]

--- nnmail.el	1997/02/02 21:31:10	1.1
+++ nnmail.el	1997/02/02 21:33:46
@@ -1133,7 +1133,7 @@
    ;; Check the cache for the regexp for this split.
    ;; FIX FIX FIX could avoid calling assq twice here
    ((assq split nnmail-split-cache)
-    (goto-char (point-max))
+    (goto-char (point-min))
     ;; FIX FIX FIX problem with re-search-backward is that if you have
     ;; a split: (from "foo-\\(bar\\|baz\\)@gnus.org "mail.foo.\\1")
     ;; and someone mails a message with 'To: foo-bar@gnus.org' and
@@ -1148,15 +1148,15 @@
     ;; removed duplicates, since there might be more of those.
     ;; I guess we could also remove duplicates in the & split case, since
     ;; that's the only thing that can introduce them.
-    (when (re-search-backward (cdr (assq split nnmail-split-cache)) nil t)
+    (when (re-search-forward (cdr (assq split nnmail-split-cache)) nil t)
       ;; Someone might want to do a \N sub on this match, so get the
       ;; correct match positions.
-      (goto-char (match-end 0))
+      (goto-char (match-end 2))
       (let ((value (nth 1 split)))
-	(re-search-backward (if (symbolp value)
+	(re-search-forward (if (symbolp value)
 				(cdr (assq value nnmail-split-abbrev-alist))
 			      value)
-			    (match-end 1)))
+			   (match-end 0)))
       (nnmail-split-it (nth 2 split))))
 
    ;; Not in cache, compute a regexp for the field/value pair.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1997-02-05  8:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-02 22:06 nnmail-split-it Johan Danielsson
1997-02-03 23:28 ` nnmail-split-it David Moore
1997-02-04  1:29   ` nnmail-split-it Paul Franklin
1997-02-04  1:55     ` nnmail-split-it Lars Magne Ingebrigtsen
1997-02-04  4:35       ` nnmail-split-it David Moore
1997-02-04  6:16         ` nnmail-split-it anonymous
1997-02-04  8:37       ` nnmail-split-it Per Abrahamsen
1997-02-04 18:05         ` nnmail-split-it David Moore
1997-02-04 19:58           ` nnmail-split-it Lars Magne Ingebrigtsen
1997-02-05  6:44             ` nnmail-split-it Paul Franklin
1997-02-05  8:24           ` nnmail-split-it Per Abrahamsen
1997-02-04  0:46 ` nnmail-split-it Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).