From 5611bb1ffca53a0f451c71560d0d35ebe15179a9 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Fri, 2 Apr 2004 19:09:16 +0000 Subject: [PATCH] (spam-set-difference): new function to replace gnus-set-difference in spam.el (spam-summary-prepare-exit): use spam-set-difference --- lisp/ChangeLog | 6 ++++++ lisp/spam.el | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eda2149e8..09feac045 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-04-02 Teodor Zlatanov + + * spam.el (spam-set-difference): new function to replace + gnus-set-difference in spam.el + (spam-summary-prepare-exit): use spam-set-difference + 2004-03-29 Teodor Zlatanov * gnus-registry.el (gnus-registry-cache-file): updated to use diff --git a/lisp/spam.el b/lisp/spam.el index f2211fe8a..0c0a50999 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -718,7 +718,7 @@ Respects the process/prefix convention." (new-articles (spam-list-articles gnus-newsgroup-articles classification)) - (changed-articles (gnus-set-difference new-articles old-articles))) + (changed-articles (spam-set-difference new-articles old-articles))) ;; now that we have the changed articles, we go through the processors (dolist (processor-param spam-list-of-processors) (let ((processor (nth 0 processor-param)) @@ -785,6 +785,20 @@ Respects the process/prefix convention." (setq spam-old-ham-articles nil) (setq spam-old-spam-articles nil)) +(defun spam-set-difference (list1 list2) + "Return a set difference of LIST1 and LIST2. +When either list is nil, the other is returned." + (if (and list1 list2) + ;; we have two non-nil lists + (progn + (dolist (item (append list1 list2)) + (when (and (memq item list1) (memq item list2)) + (setq list1 (delq item list1)) + (setq list2 (delq item list2)))) + (append list1 list2)) + ;; if either of the lists was nil, return the other one + (if list1 list1 list2))) + (defun spam-mark-junk-as-spam-routine () ;; check the global list of group names spam-junk-mailgroups and the ;; group parameters -- 2.25.1