From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/23802 Path: main.gmane.org!not-for-mail From: Alexandre Oliva Newsgroups: gmane.emacs.gnus.general Subject: Re: `nnmail-split-fancy' regexp Date: 04 Jul 1999 19:54:09 -0300 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035161470 4029 80.91.224.250 (21 Oct 2002 00:51:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:51:10 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id SAA28981 for ; Sun, 4 Jul 1999 18:57:07 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.1/8.9.1) with ESMTP id RAB28744; Sun, 4 Jul 1999 17:56:49 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 04 Jul 1999 17:55:35 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id RAA27435 for ; Sun, 4 Jul 1999 17:55:24 -0500 (CDT) Original-Received: from grande.dcc.unicamp.br (grande.dcc.unicamp.br [143.106.1.11]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id SAA28944 for ; Sun, 4 Jul 1999 18:54:13 -0400 (EDT) Original-Received: from amazonas.dcc.unicamp.br (amazonas.dcc.unicamp.br [143.106.7.11]) by grande.dcc.unicamp.br (8.9.1/8.9.1) with ESMTP id TAA13267 for ; Sun, 4 Jul 1999 19:50:22 -0300 (EST) Original-Received: from cupuacu.lsd.dcc.unicamp.br (oliva@cupuacu.lsd.dcc.unicamp.br [143.106.24.145]) by amazonas.dcc.unicamp.br (8.8.5/8.8.5) with SMTP id TAA22322 for ; Sun, 4 Jul 1999 19:50:20 -0300 (EST) Original-To: ding@gnus.org In-Reply-To: Alexandre Oliva's message of "04 Jul 1999 18:15:36 -0300" Original-Lines: 28 User-Agent: Gnus/5.070091 (Pterodactyl Gnus v0.91) XEmacs/20.4 (Emerald) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:23802 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:23802 --=-=-= On Jul 4, 1999, Alexandre Oliva wrote: > On Jul 4, 1999, Lars Magne Ingebrigtsen wrote: >> Alexandre Oliva writes: >>> So, even though `.*' appears to be much more intuitive, it is not >>> really that intuitive if you don't happen to know what's going on >>> behind the scenes, so I'd rather have a prefix that is clearly not >>> part of the regexp. It might have been better to use a (cons 'partial >>> "regex") to denote partial matches... >> Yes, that sounds like a better idea than a "magic" prefix. > OTOH, it might break existing code that relies on the existing format. > In this sense, `.*' would be better. Even if we have to special-case > it in the splitting engine and in the docs, it would be backward > compatible. It seems to me that the attached patch is fully backward-compatible, and its outcome is not surprising, not even in terms of \N substitutions. -- Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il {oliva,Alexandre.Oliva}@dcc.unicamp.br aoliva@{acm.org,computer.org} oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org} *** E-mail about software projects will be forwarded to mailing lists --=-=-= Content-Type: application/x-patch Content-Disposition: attachment; filename=split-regex.patch Index: nnmail.el --- nnmail.el 1999/07/04 21:40:44 +++ nnmail.el 1999/07/04 22:46:10 @@ -1139,13 +1173,19 @@ (let* ((field (nth 0 split)) (value (nth 1 split)) - (regexp (concat "^\\(\\(" + partial regexp) + (if (symbolp value) + (setq value (cdr (assq value nnmail-split-abbrev-alist)))) + (if (string= ".*" (substring value 0 2)) + (setq value (substring value 2) + partial "")) + (setq regexp (concat "^\\(\\(" (if (symbolp field) (cdr (assq field nnmail-split-abbrev-alist)) field) - "\\):.*\\)\\<\\(" - (if (symbolp value) - (cdr (assq value nnmail-split-abbrev-alist)) - value) - "\\)\\>"))) + "\\):.*\\)" + (or partial "\\<") + "\\(" + value + "\\)\\>")) (push (cons split regexp) nnmail-split-cache) ;; Now that it's in the cache, just call nnmail-split-it again --=-=-=--