From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19032: 24.4; icomplete cannot select matches with C-x b with no input Date: Thu, 13 Aug 2020 09:43:41 -0400 Message-ID: References: <8761egqcyr.fsf@matt-desktop.home> <874kp6hotd.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6391"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Matthew Leach , 19032@debbugs.gnu.org, Ole Laursen To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 13 15:44:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6DWc-0001Yk-Nv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 15:44:10 +0200 Original-Received: from localhost ([::1]:55794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6DWb-0007KY-QY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 09:44:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6DWT-0007IN-UI for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 09:44:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6DWT-0004dx-KU for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 09:44:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k6DWT-0002hr-It for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 09:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Aug 2020 13:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19032 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19032-submit@debbugs.gnu.org id=B19032.159732623110382 (code B ref 19032); Thu, 13 Aug 2020 13:44:01 +0000 Original-Received: (at 19032) by debbugs.gnu.org; 13 Aug 2020 13:43:51 +0000 Original-Received: from localhost ([127.0.0.1]:47456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6DWJ-0002hN-FA for submit@debbugs.gnu.org; Thu, 13 Aug 2020 09:43:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6DWG-0002h9-Tx for 19032@debbugs.gnu.org; Thu, 13 Aug 2020 09:43:50 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4AE6E44127F; Thu, 13 Aug 2020 09:43:43 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CE2D044127C; Thu, 13 Aug 2020 09:43:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1597326221; bh=WJKVKhrp7x26DStHUHt2lfOjVfF3arkbL2mqMlCuLz4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=bKTZjiZOoE36rvvA7w0DoYycj3LZOoFTOWxZ3R2St98TiLtF8iudu7QXkrpQsb+fv gNyekR5fFsAV0H6fV5meKSFsSRcAzNk399PR5JKOsca2FA4OJzptUbj5SM5sbgFj2S oYmxsaGSczwDDpchoGz/UpvBXRcbzWxrr9AJrY8+yBnkTgrK95Lxt1zkFK/Hjf9wQk XRsf+hjjYr5ofKde8mHjzxCtXSmHYuwNDuB5OyQuGX7v3O0Iu5fWU/4kbLKTwviROa DqrjsI+1N94hYYURF3zIdsfXqEBI1SVBYwKXuzBhqhunZGkRS7VuKrtl0bLSUsalrm MhavqYgvURpcA== Original-Received: from alfajor (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9DB8912036E; Thu, 13 Aug 2020 09:43:41 -0400 (EDT) In-Reply-To: <874kp6hotd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 13 Aug 2020 11:34:22 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:185024 Archived-At: > +(defvar completion-use-stored-completions-when-no-input nil) > (defvar completion-fail-discreetly nil > "If non-nil, stay quiet when there is no match.") > @@ -1510,8 +1511,15 @@ completion--complete-and-exit > COMPLETION-FUNCTION is called if the current buffer's content does not > appear to be a match." > (cond > - ;; Allow user to specify null string > - ((= beg end) (funcall exit-function)) > + ;; Allow user to specify null string. In the case that > + ;; `completion-use-stored-completions-when-no-input' is t, use > + ;; the car of `completion-all-sorted-completions' as the > + ;; candidate. > + ((= beg end) > + (when completion-use-stored-completions-when-no-input > + (completion--replace beg end (car completion-all-sorted-completions))) > + (funcall exit-function)) Would it be cleaner to have the following instead? ;; Allow user to specify null string. Obey `completion-content-when-empty`. ((= beg end) (when completion-content-when-empty (completion--replace beg end completion-content-when-empty)) (funcall exit-function)) So icomplete would be in charge of setting that var to the `car` of `completion-all-sorted-completions`. Stefan