Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Subject: Re: nnmail-split-fancy-match-partial-words
Date: Tue, 07 Mar 2006 18:55:58 +0900	[thread overview]
Message-ID: <b4mu0aazihd.fsf@jpl.org> (raw)
In-Reply-To: <b4mfylw43zp.fsf@jpl.org>

>>>>> In <b4mfylw43zp.fsf@jpl.org> Katsumi Yamaoka wrote:

>>     Reiner>  ("subject" ".*\\[ce\\].*" foo.ce t)

>> I would like it, especially if the 4th element is optional.

>>>>>> In <v9k6b8blyd.fsf@marauder.physik.uni-ulm.de>
>>>>>>	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.



  parent reply	other threads:[~2006-03-07  9:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-03  9:45 nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-03 11:13 ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-03 14:38   ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-05 20:39     ` nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-05 21:50       ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-06  4:00         ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-06  8:19           ` nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-07  9:55           ` Katsumi Yamaoka [this message]
2006-03-08  9:06             ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-09 15:41               ` nnmail-split-fancy-match-partial-words Reiner Steib
2006-03-10  2:02                 ` nnmail-split-fancy-match-partial-words Katsumi Yamaoka
2006-03-05 20:43     ` nnmail-split-fancy-match-partial-words Fabrice Popineau
2006-03-06 15:45       ` set-file-modes (XEmacs on w32) (was: nnmail-split-fancy-match-partial-words) Reiner Steib
2006-03-09 20:50         ` set-file-modes (XEmacs on w32) Reiner Steib

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=b4mu0aazihd.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    /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).