From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Newsgroups: gmane.emacs.bugs Subject: bug#21644: 24.4; completing-read acts differently on functional collection Date: Mon, 12 Oct 2015 18:34:40 -0700 Message-ID: <561C5FB0.6030105@thompsonclan.org> References: <5615A2EA.4@thompsonclan.org> <87vbahmzwd.fsf@gmail.com> <561C5D0B.9070303@yandex.ru> 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 1444700427 26821 80.91.229.3 (13 Oct 2015 01:40:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2015 01:40:27 +0000 (UTC) Cc: 21644@debbugs.gnu.org To: Dmitry Gutov , Oleh Krehel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 13 03:40:16 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 1ZloZZ-0005aE-Q9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Oct 2015 03:40:13 +0200 Original-Received: from localhost ([::1]:59915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloZY-0007oZ-T2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Oct 2015 21:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloZU-0007nT-9k for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:40:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZloZP-0001TZ-99 for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:40:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZloZP-0001Sz-30 for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZloZO-0004v1-8T for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2015 21:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ryan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Oct 2015 01:40:02 +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.144470036818858 (code B ref 21644); Tue, 13 Oct 2015 01:40:02 +0000 Original-Received: (at 21644) by debbugs.gnu.org; 13 Oct 2015 01:39:28 +0000 Original-Received: from localhost ([127.0.0.1]:37626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZloYp-0004u5-Ry for submit@debbugs.gnu.org; Mon, 12 Oct 2015 21:39:28 -0400 Original-Received: from mail-pa0-f43.google.com ([209.85.220.43]:34274) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZloYn-0004tv-La for 21644@debbugs.gnu.org; Mon, 12 Oct 2015 21:39:26 -0400 Original-Received: by padhy16 with SMTP id hy16so4199037pad.1 for <21644@debbugs.gnu.org>; Mon, 12 Oct 2015 18:39:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Q9viK6QFr7mDMT+qZHKY6yHzzSftwOWl/5QdGrA19Zc=; b=LtQiDldpzGam1GPRwoMeuJ4Az8Wj6rQpXHnQ4DyTmdMZnmR9hojxNp2+wbBFd6QRCc sAI7RVRw1IKBp6FAHpreUWJqqkNAZ1+O8pFO7G2yfEbPAQO95ZmLi0M1rBN67HHwSMl2 xi9JKrGEMkfB7t7KGWxecS31wpHv8SRuwPstG9wcWq+PVf38SWoisUXSGBRxiIPyy/13 OjBMrM+5U6UKQDQ39Rgco93CHySYSAX9Z9QFV71L+rs6XEkMsoJ+Xib6ed+NjTuNx0dU gadTTlZe7JouAJnwes07ixJMGfNt9JcdJLGppMy0ITXMBJUPTLVuuLIEMNL1q2eUcFar 1qhw== X-Gm-Message-State: ALoCoQnUkkXfb/1TZPaAiN3k3C2ieIEC1rZG7ALLcYvnD02LtU1A8WDIwtsM/ZhwpM+Vu3GJGng6 X-Received: by 10.67.3.167 with SMTP id bx7mr37812480pad.47.1444700364858; Mon, 12 Oct 2015 18:39:24 -0700 (PDT) Original-Received: from [192.168.10.2] ([209.134.95.68]) by smtp.googlemail.com with ESMTPSA id fa14sm394021pac.8.2015.10.12.18.39.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Oct 2015 18:39:23 -0700 (PDT) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <561C5D0B.9070303@yandex.ru> 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:107556 Archived-At: On 10/12/15 6:23 PM, Dmitry Gutov wrote: > 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)))) > > 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?