unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ryan <rct@thompsonclan.org>
Cc: 21644@debbugs.gnu.org, Oleh Krehel <ohwoeowho@gmail.com>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#21644: 24.4; completing-read acts differently on functional collection
Date: Fri, 16 Oct 2015 09:12:31 -0400	[thread overview]
Message-ID: <jwv7fmn6ju1.fsf-monnier+bug#21644@gnu.org> (raw)
In-Reply-To: <561C5FB0.6030105@thompsonclan.org> (Ryan's message of "Mon, 12 Oct 2015 18:34:40 -0700")

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





  parent reply	other threads:[~2015-10-16 13:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 22:55 bug#21644: 24.4; completing-read acts differently on functional collection Ryan C. Thompson
2015-10-08 10:13 ` Oleh Krehel
2015-10-13  1:23   ` Dmitry Gutov
2015-10-13  1:34     ` Ryan
2015-10-13  2:27       ` Dmitry Gutov
2015-10-13 18:59         ` Ryan C. Thompson
2015-10-15  5:12           ` Dmitry Gutov
2015-10-15  5:17             ` Ryan
2015-10-15  9:18               ` Dmitry Gutov
2015-10-15 15:01             ` Drew Adams
2015-10-15 15:24               ` Dmitry Gutov
2015-10-15 16:47                 ` Drew Adams
2015-10-15 17:03                   ` Dmitry Gutov
2015-10-15 20:28                     ` Drew Adams
2015-10-15 21:07                       ` Dmitry Gutov
2015-10-16  9:45                         ` Eli Zaretskii
2015-10-16 10:24                           ` Dmitry Gutov
2015-10-16  9:46                         ` Eli Zaretskii
2015-10-16  9:54                           ` Dmitry Gutov
2015-10-16 13:12                           ` Stefan Monnier
2015-10-16 13:44                             ` Eli Zaretskii
2015-10-16 14:03                               ` Stefan Monnier
2015-10-16 13:12       ` Stefan Monnier [this message]
     [not found] <<5615A2EA.4@thompsonclan.org>
     [not found] ` <<87vbahmzwd.fsf@gmail.com>
     [not found]   ` <<561C5D0B.9070303@yandex.ru>
     [not found]     ` <<561C5FB0.6030105@thompsonclan.org>
     [not found]       ` <<561C6C12.20803@yandex.ru>
     [not found]         ` <<561D54AF.7090701@thompsonclan.org>
     [not found]           ` <<561F35AD.8000803@yandex.ru>
     [not found]             ` <<c92dc5c7-bf93-4040-9da1-96b1a57b560a@default>
     [not found]               ` <<561FC52F.1010606@yandex.ru>
     [not found]                 ` <<4fe19dae-4269-401b-82bd-10f9d368a921@default>
     [not found]                   ` <<561FDC63.6010609@yandex.ru>
     [not found]                     ` <<917e38a9-d74b-4e41-bc7b-90aeee69584c@default>
     [not found]                       ` <<5620159C.3060401@yandex.ru>
     [not found]                         ` <<837fmn6tb3.fsf@gnu.org>
2015-10-16 15:53                           ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwv7fmn6ju1.fsf-monnier+bug#21644@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=21644@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=ohwoeowho@gmail.com \
    --cc=rct@thompsonclan.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).