Function: gnus-sorted-difference

gnus-sorted-difference is an autoloaded and byte-compiled function defined in gnus-range.el.gz.

Signature

(gnus-sorted-difference LIST1 LIST2)

Documentation

Return a list of elements of LIST1 that do not appear in LIST2.

Both lists have to be sorted over <. The tail of LIST1 is not copied.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-range.el.gz
;;;###autoload
(defun gnus-sorted-difference (list1 list2)
  "Return a list of elements of LIST1 that do not appear in LIST2.
Both lists have to be sorted over <.
The tail of LIST1 is not copied."
  (let (out)
    (while (and list1 list2)
      (cond ((= (car list1) (car list2))
	     (setq list1 (cdr list1)
		   list2 (cdr list2)))
	    ((< (car list1) (car list2))
	     (setq out (cons (car list1) out))
	     (setq list1 (cdr list1)))
	    (t
	     (setq list2 (cdr list2)))))
    (nconc (nreverse out) list1)))