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

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

bug#21644: 24.4; completing-read acts differently on functional collecti


From: Stefan Monnier
Subject: bug#21644: 24.4; completing-read acts differently on functional collection
Date: Fri, 16 Oct 2015 09:12:31 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> (if (functionp collection)
>> collection
>> ;; Capture collection in a closure
>> (lambda (string pred all)
>> (funcall
>> (cond
>> ((eq all 't)
>> #'all-completions)
>> ((eq all 'lambda)
>> #'test-completion)
>> (t
>> #'try-completion))
>> string collection pred))))
> I wasn't aware of `test-completion'. I was going based on the docstring for
> `completing-read', which only mentions `try-completion' and
> `all-completions'. Is there any other documentation I should have consulted?

Don't write the code above.  Use complete-with-action (or
completion-table-dynamic if that fits your need) which should handle all
the possible values of `all', including the new ones we'll introduce in
Emacs-27.


        Stefan





reply via email to

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