From: vitaly Date: Sun, 8 Feb 2009 13:26:30 +0000 (+0100) Subject: New helper function: elmo-union X-Git-Url: https://repo.or.cz/w/more-wl.git/commitdiff_plain/7601c9e4614b1de5875f0def1033e9dda1fc2180 New helper function: elmo-union Makes a union of two possibly unsorted lists. --- diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index f5191fb..b796432 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -485,6 +485,10 @@ Return value is a cons cell of (STRUCTURE . REST)" (setq list (cdr list)))) list) +(defun elmo-union (l1 l2) + "Make a union of two lists" + (elmo-uniq-sorted-list (sort (append l1 l2) #'<))) + (defun elmo-list-insert (list element after) (let* ((match (memq after list)) (rest (and match (cdr (memq after list)))))