X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fgnus-util.el;h=6759c0715b79ee6f427a14217b4c82b43ecda1a6;hp=40e2dcf92fdd858ce9689fcac296e6c3165b759a;hb=ac9f01c45db8c08ffa835bbcdc2662ed14f40a73;hpb=386e4d3ea54d4898bd5c7447991a116a1ef2c11f diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 40e2dcf92..6759c0715 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1372,18 +1372,25 @@ Return the modified alist." (if (fboundp 'union) (defalias 'gnus-union 'union) - (defun gnus-union (l1 l2) - "Set union of lists L1 and L2." + (defun gnus-union (l1 l2 &rest keys) + "Set union of lists L1 and L2. +If KEYS contains the `:test' and `equal' pair, use `equal' to compare +items in lists, otherwise use `eq'." (cond ((null l1) l2) ((null l2) l1) ((equal l1 l2) l1) (t (or (>= (length l1) (length l2)) (setq l1 (prog1 l2 (setq l2 l1)))) - (while l2 - (or (member (car l2) l1) - (push (car l2) l1)) - (pop l2)) + (if (eq 'equal (plist-get keys :test)) + (while l2 + (or (member (car l2) l1) + (push (car l2) l1)) + (pop l2)) + (while l2 + (or (memq (car l2) l1) + (push (car l2) l1)) + (pop l2))) l1)))) (declare-function gnus-add-text-properties "gnus"