From: Nevin Kapur <nevin@jhu.edu>
Subject: Re: How to match '[' in nnmail-split-fancy
Date: 02 Apr 2001 11:46:35 -0400 [thread overview]
Message-ID: <m3wv93s3s4.fsf@fermat.mts.jhu.edu> (raw)
In-Reply-To: <vaf8zljkf9x.fsf@lucy.cs.uni-dortmund.de> (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Mon, 02 Apr 2001 08:05:30 +0200")
On Mon, 02 Apr 2001, Kai Großjohann wrote:
> I think a similar trick should be done for the end of the regexp.
> Hm... Yes, look after line 1232 in nnmail.el, there you can see the
> special case for splits beginning with ".*". I think partial should
> be renamed to partial-front and a similar partial-rear variable
> should be introduced.
>
> Opinions?
It makes sense to me. If there is a consensus to add this twist,
here's the patch against the latest CVS.
cvs server: Diffing lisp
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 6.393
diff -u -r6.393 ChangeLog
--- lisp/ChangeLog 2001/04/01 23:25:12 6.393
+++ lisp/ChangeLog 2001/04/01 15:35:16
@@ -1,3 +1,8 @@
+2001-04-02 Nevin Kapur <nevin@jhu.edu>
+
+ * nnmail.el (nnmail-split-it): Added check for .* at the end of
+ regexp in nnmail-split-fancy.
+
2001-04-02 00:40:12 Lars Magne Ingebrigtsen <larsi@gnus.org>
* message.el (message-check-news-header-syntax): Question even
Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 6.10
diff -u -r6.10 nnmail.el
--- lisp/nnmail.el 2001/02/08 23:53:22 6.10
+++ lisp/nnmail.el 2001/04/01 15:35:20
@@ -1233,22 +1233,29 @@
(t
(let* ((field (nth 0 split))
(value (nth 1 split))
- partial regexp)
+ partial-front regexp
+ partial-rear regexp)
(if (symbolp value)
(setq value (cdr (assq value nnmail-split-abbrev-alist))))
(if (and (>= (length value) 2)
(string= ".*" (substring value 0 2)))
(setq value (substring value 2)
- partial ""))
+ partial-front ""))
+ ;; Same trick for the rear of the regexp
+ (if (and (>= (length value) 2)
+ (string= ".*" (substring value -2)))
+ (setq value (substring value 0 -2)
+ partial-rear ""))
(setq regexp (concat "^\\(\\("
(if (symbolp field)
(cdr (assq field nnmail-split-abbrev-alist))
field)
"\\):.*\\)"
- (or partial "\\<")
+ (or partial-front "\\<")
"\\("
value
- "\\)\\>"))
+ "\\)"
+ (or partial-rear "\\>")))
(push (cons split regexp) nnmail-split-cache)
;; Now that it's in the cache, just call nnmail-split-it again
;; on the same split, which will find it immediately in the cache.
--
Nevin
next prev parent reply other threads:[~2001-04-02 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-01 21:33 Nevin Kapur
2001-04-01 21:53 ` Kai Großjohann
2001-04-02 0:32 ` Nevin Kapur
2001-04-02 6:05 ` Kai Großjohann
2001-04-02 15:46 ` Nevin Kapur [this message]
2001-04-11 11:52 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3wv93s3s4.fsf@fermat.mts.jhu.edu \
--to=nevin@jhu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).