help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best way to get the list of unique keys from 2 alists


From: Kevin Rodgers
Subject: Re: best way to get the list of unique keys from 2 alists
Date: Mon, 19 Dec 2005 11:50:18 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Stefan Monnier wrote:
I've got 2 alists of (SYMBOL . "STRING") pairs, and I need to get the
list of unique symbol names to pass to completing-read as its TABLE
argument: (("SYMBOL-NAME") ...)


I'd just do:

    (completing-read "foo" (mapcar (lambda (x) (symbol-name (car x)))
                                   (append list1 list2)))

You don't need to remove duplicates.

In 21.4 the TABLE elements must be lists, and duplicates are displayed
in the *Completions* buffer.

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]