From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#21644: 24.4; completing-read acts differently on functional collection Date: Tue, 13 Oct 2015 04:23:23 +0300 Message-ID: <561C5D0B.9070303@yandex.ru> References: <5615A2EA.4@thompsonclan.org> <87vbahmzwd.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1444699464 14034 80.91.229.3 (13 Oct 2015 01:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2015 01:24:24 +0000 (UTC) Cc: 21644@debbugs.gnu.org To: Oleh Krehel , "Ryan C. Thompson" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 13 03:24:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZloK3-0005w4-Di for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Oct 2015 03:24:11 +0200 Original-Received: from localhost ([::1]:59868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloK2-0004XM-Lt for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Oct 2015 21:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloJy-0004X1-Lu for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZloJu-0004fp-6k for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloJu-0004fl-2t for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZloJt-0004To-P3 for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Oct 2015 01:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21644 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21644-submit@debbugs.gnu.org id=B21644.144469940817174 (code B ref 21644); Tue, 13 Oct 2015 01:24:01 +0000 Original-Received: (at 21644) by debbugs.gnu.org; 13 Oct 2015 01:23:28 +0000 Original-Received: from localhost ([127.0.0.1]:37612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZloJM-0004Sv-8D for submit@debbugs.gnu.org; Mon, 12 Oct 2015 21:23:28 -0400 Original-Received: from mail-wi0-f172.google.com ([209.85.212.172]:37891) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZloJJ-0004Sn-UP for 21644@debbugs.gnu.org; Mon, 12 Oct 2015 21:23:26 -0400 Original-Received: by wieq12 with SMTP id q12so7921076wie.1 for <21644@debbugs.gnu.org>; Mon, 12 Oct 2015 18:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=LbwzHsZEE18fh438fkakKRuogZ2WazYnC+cixEKcT+I=; b=myAaclYs+Akd/++9elhp/YDLM7rr/TvZUTLCpWFApuoO5m2xlg0PO9v8HHckn5BSzD nm71Pb/ZolkrhQb96w3DPDO/RNZ4G2F7GhP4wNHc3lE/Vn8pYc81e9q1b7MaiZBRu350 HKmGbG4/GnRqoUxJilo6M86IHzXoOkf+dFLG0u5By4s3GweGnvHyz0RUc6hA8IcVXZ7U 6El8RrgO/hvhVNlBsUDIv4sece6gB90PZ3rX0WrNjrTWQl4uSNHDbDkv1YQz3+4Ia9KQ ujMwHWbmlMf9xDQC97fTREVdYfWxDX8GmfOEic3k5+cUvf95EElBHqt+WjuTLepZeDxv cC0Q== X-Received: by 10.180.186.98 with SMTP id fj2mr18610307wic.58.1444699405270; Mon, 12 Oct 2015 18:23:25 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id hk5sm450212wjb.6.2015.10.12.18.23.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 18:23:24 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Thunderbird/41.0 In-Reply-To: <87vbahmzwd.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107553 Archived-At: 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))))