From: Katsumi Yamaoka Date: Wed, 8 Mar 2006 09:05:35 +0000 (+0000) Subject: (nnmail-split-it): Invert match-partial-words behavior if optional last element X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=3f10c39eff95582c2d26ce50973df3db3d171f59;p=gnus (nnmail-split-it): Invert match-partial-words behavior if optional last element is specified in splits (FIELD VALUE...). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ac280067..fa52260c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-03-08 Katsumi Yamaoka + + * nnmail.el (nnmail-split-it): Invert match-partial-words behavior + if optional last element is specified in splits (FIELD VALUE...). + 2006-03-07 Reiner Steib * message.el (message-make-tool-bar): Rename gmm-image-load-path diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 363386fa8..65349ea18 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1420,11 +1420,12 @@ See the documentation for the variable `nnmail-split-fancy' for details." ;; 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 @@ See the documentation for the variable `nnmail-split-fancy' for details." (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 (cadr split-rest) + (not nnmail-split-fancy-match-partial-words) + nnmail-split-fancy-match-partial-words) (setq partial-front "" partial-rear "")) (setq regexp (concat "^\\(\\(" @@ -1451,7 +1458,7 @@ See the documentation for the variable `nnmail-split-fancy' for details." (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. + ;; on the same split, which will find it immediately in the cache. (nnmail-split-it split)))))) (defun nnmail-expand-newtext (newtext)