2001-07-25 22:22:22 Raymond Scholz <rscholz@zonix.de>
[gnus] / lisp / nnmail.el
index 8a899ce..8b342e3 100644 (file)
@@ -115,6 +115,14 @@ If nil, the first match found will be used."
   :group 'nnmail-split
   :type 'boolean)
 
+(defcustom nnmail-split-fancy-with-parent-ignore-groups nil
+  "Regexp that matches group names to be ignored when applying
+`nnmail-split-fancy-with-parent'.  This can also be a list of regexps."
+  :group 'nnmail-split
+  :type '(choice (const :tag "none" nil)
+                (regexp :value ".*")
+                (repeat :value (".*") regexp)))
+
 ;; Added by gord@enci.ucalgary.ca (Gordon Matzigkeit).
 (defcustom nnmail-keep-last-article nil
   "If non-nil, nnmail will never delete/move a group's last article.
@@ -1472,14 +1480,18 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
   (let* ((refstr (or (message-fetch-field "references")
                     (message-fetch-field "in-reply-to")))
         (references nil)
-        (res nil))
+        (res nil)
+        (regexp (if (consp nnmail-split-fancy-with-parent-ignore-groups)
+                    (mapconcat 'nnmail-split-fancy-with-parent-ignore-groups " *\\|")
+                  nnmail-split-fancy-with-parent-ignore-groups)))
     (when refstr
       (setq references (nreverse (gnus-split-references refstr)))
       (unless (gnus-buffer-live-p nnmail-cache-buffer)
        (nnmail-cache-open))
       (mapcar (lambda (x)
                (setq res (or (nnmail-cache-fetch-group x) res))
-               (when (string= "drafts" res)
+               (when (or (string= "drafts" res)
+                         (and regexp (string-match regexp res)))
                  (setq res nil)))
              references)
       res)))