Subject: Re: bug#21644: 24.4; completing-read acts differently on functional collection

From: Stefan Monnier <[email-masked]>
Date: Fri, 16 Oct 2015 09:12:31 -0400

>> (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