How do I append two lists together, and delete duplicates?
For example:
(setq list1 ("a" "b" "c"))
(setq list2 ("b" "c" "d"))
(setq list3 (a b c))
(setq list4 (c d e))
;; use case
(append-list-to-list list1 list2) ; ("a" "b" "c" "d")
(append-list-to-list list3 list4) ; (a b c d e)
UPDATE after the cl-union
answer: I need to preserve the order of the resulting list.
And when there is a nested list, how do I append and make element is unique in list.
For example:
(a (b c) d) or ((a b) c d) etc
add list (x y z) to list ((a b) c d) to become ((a b x y z) c d)
Then how to append a new list to upper nested list?