comparison lisp/gnus/spam.el @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents 2212a4afa3ce
children 873a6f48b596
comparison
equal deleted inserted replaced
90260:0ca0d9181b5e 90261:7beb78bc1f8e
465 ;; convenience functions 465 ;; convenience functions
466 (defun spam-xor (a b) 466 (defun spam-xor (a b)
467 "Logical exclusive `or'." 467 "Logical exclusive `or'."
468 (and (or a b) (not (and a b)))) 468 (and (or a b) (not (and a b))))
469 469
470 (defun spam-group-ham-mark-p (group mark &optional spam)
471 (when (stringp group)
472 (let* ((marks (spam-group-ham-marks group spam))
473 (marks (if (symbolp mark)
474 marks
475 (mapcar 'symbol-value marks))))
476 (memq mark marks))))
477
478 (defun spam-group-spam-mark-p (group mark)
479 (spam-group-ham-mark-p group mark t))
480
481 (defun spam-group-ham-marks (group &optional spam) 470 (defun spam-group-ham-marks (group &optional spam)
482 (when (stringp group) 471 (when (stringp group)
483 (let* ((marks (if spam 472 (let ((marks (car (if spam
484 (gnus-parameter-spam-marks group) 473 (gnus-parameter-spam-marks group)
485 (gnus-parameter-ham-marks group))) 474 (gnus-parameter-ham-marks group)))))
486 (marks (car marks)) 475 (if (listp (car marks))
487 (marks (if (listp (car marks)) (car marks) marks))) 476 (car marks)
488 marks))) 477 marks))))
489
490 (defun spam-group-spam-marks (group)
491 (spam-group-ham-marks group t))
492 478
493 (defun spam-group-spam-contents-p (group) 479 (defun spam-group-spam-contents-p (group)
494 (if (stringp group) 480 (if (stringp group)
495 (or (member group spam-junk-mailgroups) 481 (or (member group spam-junk-mailgroups)
496 (memq 'gnus-group-spam-classification-spam 482 (memq 'gnus-group-spam-classification-spam
1048 (if (eq classification 'spam) 1034 (if (eq classification 'spam)
1049 (nth 3 flist) 1035 (nth 3 flist)
1050 (nth 2 flist)))) 1036 (nth 2 flist))))
1051 1037
1052 (defun spam-list-articles (articles classification) 1038 (defun spam-list-articles (articles classification)
1053 (let ((mark-check (if (eq classification 'spam) 1039 (let ((marks (mapcar 'eval (spam-group-ham-marks gnus-newsgroup-name
1054 'spam-group-spam-mark-p 1040 (eq classification 'spam))))
1055 'spam-group-ham-mark-p)) 1041 list)
1056 list mark-cache-yes mark-cache-no)
1057 (dolist (article articles) 1042 (dolist (article articles)
1058 (let ((mark (gnus-summary-article-mark article))) 1043 (if (memq (gnus-summary-article-mark article) marks)
1059 (unless (memq mark mark-cache-no) 1044 (push article list)))
1060 (if (memq mark mark-cache-yes)
1061 (push article list)
1062 ;; else, we have to actually check the mark
1063 (if (funcall mark-check
1064 gnus-newsgroup-name
1065 mark)
1066 (progn
1067 (push article list)
1068 (push mark mark-cache-yes))
1069 (push mark mark-cache-no))))))
1070 list)) 1045 list))
1071 1046
1072 (defun spam-register-routine (classification 1047 (defun spam-register-routine (classification
1073 check 1048 check
1074 &optional unregister 1049 &optional unregister