X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fnnmail.el;h=39b22a13a7a1ceb7b178d3ae2bcd8526664ced89;hp=2ac587e2a74e0e52d8010a2ca5b31c5a7caf5a8d;hb=eccdf85395bc593889d4f64aafbd966e33b15714;hpb=1ffddf043f9756348adebc2dbcde177e524328b1 diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 2ac587e2a..39b22a13a 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -123,6 +123,15 @@ If nil, the first match found will be used." (regexp :value ".*") (repeat :value (".*") regexp))) +(defcustom nnmail-cache-ignore-groups nil + "Regexp that matches group names to be ignored when inserting message +ids into the cache (`nnmail-cache-insert'). 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. @@ -1477,7 +1486,12 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (if (and grp (not (string= "" grp)) (gnus-methods-equal-p gnus-command-method (nnmail-cache-primary-mail-backend))) - (insert id "\t" grp "\n") + (let ((regexp (if (consp nnmail-cache-ignore-groups) + (mapconcat 'identity nnmail-cache-ignore-groups + "\\|") + nnmail-cache-ignore-groups))) + (unless (and regexp (string-match regexp grp)) + (insert id "\t" grp "\n"))) (insert id "\n"))))) (defun nnmail-cache-primary-mail-backend ()