unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Oleh Krehel <ohwoeowho@gmail.com>,
	"Ryan C. Thompson" <rct@thompsonclan.org>
Cc: 21644@debbugs.gnu.org
Subject: bug#21644: 24.4; completing-read acts differently on functional collection
Date: Tue, 13 Oct 2015 04:23:23 +0300	[thread overview]
Message-ID: <561C5D0B.9070303@yandex.ru> (raw)
In-Reply-To: <87vbahmzwd.fsf@gmail.com>

On 10/08/2015 01:13 PM, Oleh Krehel wrote:

> I can reproduce this as well, although "TAB RET" works where "RET"
> doesn't. I attach a patch with a fix. If someone can check it I can push
> it. The patch doesn't solve all the intricacies of
> `completion-ignore-case' that were mentioned in that function's
> comments, just this specific use case.

Is there really a bug here?

The example code didn't handle `test-completion' (the case when ALL 
would be `lambda').

With this definition, the behavior is the same in either case:

(defun collection-as-function (collection)
   "Return a function equivalent to COLLECTION.

The returned function will work equivalently to COLLECTION when
passed to `all-completions' and `try-completion'."
   (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))))







  reply	other threads:[~2015-10-13  1:23 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 [this message]
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
     [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=561C5D0B.9070303@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=21644@debbugs.gnu.org \
    --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).