summaryrefslogtreecommitdiff
path: root/lisp/gnus/spam.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/spam.el')
-rw-r--r--lisp/gnus/spam.el28
1 files changed, 18 insertions, 10 deletions
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 3f978918b9a..cfef69f1031 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -663,13 +663,13 @@ order for SpamAssassin to recognize the new registered spam."
;;; Key bindings for spam control.
-(gnus-define-keys gnus-summary-mode-map
- "St" spam-generic-score
- "Sx" gnus-summary-mark-as-spam
- "Mst" spam-generic-score
- "Msx" gnus-summary-mark-as-spam
- "\M-d" gnus-summary-mark-as-spam
- "$" gnus-summary-mark-as-spam)
+(define-keymap :keymap gnus-summary-mode-map
+ "St" #'spam-generic-score
+ "Sx" #'gnus-summary-mark-as-spam
+ "Mst" #'spam-generic-score
+ "Msx" #'gnus-summary-mark-as-spam
+ "\M-d" #'gnus-summary-mark-as-spam
+ "$" #'gnus-summary-mark-as-spam)
(defvar spam-cache-lookups t
"Whether spam.el will try to cache lookups using `spam-caches'.")
@@ -710,8 +710,16 @@ finds ham or spam.")
(defun spam-set-difference (list1 list2)
"Return a set difference of LIST1 and LIST2.
When either list is nil, the other is returned."
- (declare (obsolete seq-difference "28.1"))
- (seq-difference list1 list2 #'eq))
+ (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-group-ham-mark-p (group mark &optional spam)
"Checks if MARK is considered a ham mark in GROUP."
@@ -1319,7 +1327,7 @@ In the case of mover backends, checks the setting of
(new-articles (spam-list-articles
gnus-newsgroup-articles
classification))
- (changed-articles (seq-difference new-articles old-articles #'eq)))
+ (changed-articles (spam-set-difference new-articles old-articles)))
;; now that we have the changed articles, we go through the processors
(dolist (backend (spam-backend-list))
(let (unregister-list)