emacs-devel
[Top][All Lists]
Advanced

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

Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package


From: Thierry Volpiatto
Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico
Date: Fri, 09 Apr 2021 08:40:14 +0200
User-agent: mu4e 1.5.11; emacs 27.2

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> We've all written this a million times:
>
> (let* ((choices (mapcar (lambda (elt)
>                         (cons (make-string-from-thing elt)
>                               elt))
>                       my-list-of-things))
>        (choice (completing-read "Choose: "
>                               choices)))
>   (cdr (assoc-string choice choices)))

Sorry, I didn't follow the whole thread (too long), here some Helm
features you may not be aware of:


(helm-comp-read "test: " '(("un" . 1) ("deux" . 2) ("trois" . 3)))
=> 1
(helm-comp-read "test: " '(("un" . 1) ("deux" . 2) ("trois" . 3)) :alistp nil)
=> "un"
(helm-comp-read "test: " '(("un" . 1) ("deux" . 2) ("trois" . 3)) 
:marked-candidates t)
=> (1)
(helm-comp-read "test: " '(("un" . 1) ("deux" . 2) ("trois" . 3)) 
:marked-candidates t :alistp nil)
=> ("un")

Hope that helps.

-- 
Thierry

Attachment: signature.asc
Description: PGP signature


reply via email to

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