Function: spam-set-difference

spam-set-difference is a byte-compiled function defined in spam.el.gz.

Signature

(spam-set-difference LIST1 LIST2)

Documentation

Return a set difference of LIST1 and LIST2.

When either list is nil, the other is returned.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam.el.gz
(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)))