GNU bug report logs - #21644
24.4; completing-read acts differently on functional collection

Previous Next

Package: emacs;

Reported by: "Ryan C. Thompson" <rct <at> thompsonclan.org>

Date: Wed, 7 Oct 2015 22:57:01 UTC

Severity: normal

Found in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ryan <rct <at> thompsonclan.org>
Cc: 21644 <at> debbugs.gnu.org, Oleh Krehel <ohwoeowho <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#21644: 24.4; completing-read acts differently on functional collection
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




This bug report was last modified 9 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.