diff options
author | Reiner Steib <Reiner.Steib@gmx.de> | 2006-01-19 21:42:22 +0000 |
---|---|---|
committer | Reiner Steib <Reiner.Steib@gmx.de> | 2006-01-19 21:42:22 +0000 |
commit | 30c7240d141cb17ce35f762ba0d4e1a423160588 (patch) | |
tree | b49c5df7330d83db61f507b5440d02f4c89c2587 /lisp/gnus/spam.el | |
parent | 995f2df9d1c12c73077ecced0530bafa5cf91cf9 (diff) | |
download | emacs-30c7240d141cb17ce35f762ba0d4e1a423160588.tar.gz |
(spam-group-ham-mark-p, spam-group-spam-mark-p)
(spam-group-spam-marks, spam-list-articles, spam-group-ham-marks):
Revert 2006-01-08 change because the functions will be used in No
Gnus.
Diffstat (limited to 'lisp/gnus/spam.el')
-rw-r--r-- | lisp/gnus/spam.el | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index 8b722c95586..32de2f60e22 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -467,14 +467,28 @@ spamoracle database." "Logical exclusive `or'." (and (or a b) (not (and a b)))) +(defun spam-group-ham-mark-p (group mark &optional spam) + (when (stringp group) + (let* ((marks (spam-group-ham-marks group spam)) + (marks (if (symbolp mark) + marks + (mapcar 'symbol-value marks)))) + (memq mark marks)))) + +(defun spam-group-spam-mark-p (group mark) + (spam-group-ham-mark-p group mark t)) + (defun spam-group-ham-marks (group &optional spam) (when (stringp group) - (let ((marks (car (if spam - (gnus-parameter-spam-marks group) - (gnus-parameter-ham-marks group))))) - (if (listp (car marks)) - (car marks) - marks)))) + (let* ((marks (if spam + (gnus-parameter-spam-marks group) + (gnus-parameter-ham-marks group))) + (marks (car marks)) + (marks (if (listp (car marks)) (car marks) marks))) + marks))) + +(defun spam-group-spam-marks (group) + (spam-group-ham-marks group t)) (defun spam-group-spam-contents-p (group) (if (stringp group) @@ -1036,12 +1050,23 @@ functions") (nth 2 flist)))) (defun spam-list-articles (articles classification) - (let ((marks (mapcar 'eval (spam-group-ham-marks gnus-newsgroup-name - (eq classification 'spam)))) - list) + (let ((mark-check (if (eq classification 'spam) + 'spam-group-spam-mark-p + 'spam-group-ham-mark-p)) + list mark-cache-yes mark-cache-no) (dolist (article articles) - (if (memq (gnus-summary-article-mark article) marks) - (push article list))) + (let ((mark (gnus-summary-article-mark article))) + (unless (memq mark mark-cache-no) + (if (memq mark mark-cache-yes) + (push article list) + ;; else, we have to actually check the mark + (if (funcall mark-check + gnus-newsgroup-name + mark) + (progn + (push article list) + (push mark mark-cache-yes)) + (push mark mark-cache-no)))))) list)) (defun spam-register-routine (classification |