From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62180 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: nnmail-split-fancy-match-partial-words Date: Tue, 07 Mar 2006 18:55:58 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1141725644 12520 80.91.229.2 (7 Mar 2006 10:00:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Mar 2006 10:00:44 +0000 (UTC) Original-X-From: ding-owner+m10708@lists.math.uh.edu Tue Mar 07 11:00:42 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FGYzb-0004xZ-2M for ding-account@gmane.org; Tue, 07 Mar 2006 11:00:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1FGYzR-0003Ud-00; Tue, 07 Mar 2006 04:00:25 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FGYvJ-0003UX-00 for ding@lists.math.uh.edu; Tue, 07 Mar 2006 03:56:09 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FGYvH-0002Sy-I4 for ding@lists.math.uh.edu; Tue, 07 Mar 2006 03:56:09 -0600 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FGYvG-0007tn-00 for ; Tue, 07 Mar 2006 10:56:06 +0100 Original-Received: from [205.234.185.198] (port=37552 helo=mail.jpl.org) by washington.hostforweb.net with esmtpa (Exim 4.52) id 1FGYw6-0003Qq-Vo for ding@gnus.org; Tue, 07 Mar 2006 03:56:59 -0600 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:aglNRVtlyElUyGaNroi/INj6sEA= X-Hashcash: 1:20:060307:ding@gnus.org::QNZTYdT/SUGNV0T+:00003nVR X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62180 Archived-At: >>>>> In Katsumi Yamaoka wrote: >> Reiner> ("subject" ".*\\[ce\\].*" foo.ce t) >> I would like it, especially if the 4th element is optional. >>>>>> In >>>>>> Reiner Steib wrote: >> Sure, else it won't be backwards compatible. > That's a bright idea. It will help people who have no choice > but to set `nnmail-split-fancy-match-partial-words' to t for all > split rules even though it is required for only a few special > cases. Well, I'll do it in the near future if nobody stands. I changed the meaning of the last element into inverting the match-partial-words behavior. For instance, the partial-words matching will be made if the last element is set even if `nnmail-split-fancy-match-partial-words' is nil. Contrarily, the partial-words matching will not be made if the last element is set even if `nnmail-split-fancy-match-partial-words' is non-nil. The patch to No Gnus is below. I'll install this change, add a description to the Info, and improve some descriptions about the partial-words matching, maybe tomorrow[1], in both the trunk and the v5-10 branch[2]. --8<---------------cut here---------------start------------->8--- --- nnmail.el~ 2006-02-08 05:42:25 +0000 +++ nnmail.el 2006-03-07 09:52:16 +0000 @@ -1420,11 +1420,12 @@ ;; Not in cache, compute a regexp for the field/value pair. (t - (let* ((field (nth 0 split)) - (value (nth 1 split)) - partial-front - partial-rear - regexp) + (let ((field (nth 0 split)) + (value (nth 1 split)) + (split-rest (cddr split)) + partial-front + partial-rear + regexp) (if (symbolp value) (setq value (cdr (assq value nnmail-split-abbrev-alist)))) (if (and (>= (length value) 2) @@ -1436,7 +1437,13 @@ (string= ".*" (substring value -2))) (setq value (substring value 0 -2) partial-rear "")) - (when nnmail-split-fancy-match-partial-words + ;; Invert the match-partial-words behavior if the optional + ;; last element is specified. + (while (eq (car split-rest) '-) + (setq split-rest (cddr split-rest))) + (when (if (cdr split-rest) + (not nnmail-split-fancy-match-partial-words) + nnmail-split-fancy-match-partial-words) (setq partial-front "" partial-rear "")) (setq regexp (concat "^\\(\\(" --8<---------------cut here---------------end--------------->8--- [1] I need much more time for writing English text than Lisp code ;-). [2] I need to be able to run both the versions with the same ~/.gnus.el file.