From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#45474: Icomplete exhibiting in recursive minibuffer when it =?UTF-8?Q?shouldn=E2=80=99t?= Date: Sat, 17 Apr 2021 21:35:20 +0000 Message-ID: <1869622e16546eafd9df@heytings.org> References: <3ed97a9c53e0a5d4fef8@heytings.org> <87fszrz21d.fsf@mail.linkov.net> <3ed97a9c530093aca93d@heytings.org> <7dee3f4235d331cab291@heytings.org> <87r1jatd34.fsf@mail.linkov.net> <7dee3f423551aaf318cb@heytings.org> <87im4kzlfm.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35317"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dario Gjorgjevski , Stefan Monnier , 45474@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 17 23:36:39 2021 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 1lXscJ-00095x-Sd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Apr 2021 23:36:39 +0200 Original-Received: from localhost ([::1]:50664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXscI-0002dV-Dm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Apr 2021 17:36:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXsbi-0002cG-8l for bug-gnu-emacs@gnu.org; Sat, 17 Apr 2021 17:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXsbh-0001PV-TY for bug-gnu-emacs@gnu.org; Sat, 17 Apr 2021 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXsbh-00087W-Q5 for bug-gnu-emacs@gnu.org; Sat, 17 Apr 2021 17:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Apr 2021 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45474 X-GNU-PR-Package: emacs Original-Received: via spool by 45474-submit@debbugs.gnu.org id=B45474.161869532331171 (code B ref 45474); Sat, 17 Apr 2021 21:36:01 +0000 Original-Received: (at 45474) by debbugs.gnu.org; 17 Apr 2021 21:35:23 +0000 Original-Received: from localhost ([127.0.0.1]:44818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXsb5-00086h-Jf for submit@debbugs.gnu.org; Sat, 17 Apr 2021 17:35:23 -0400 Original-Received: from heytings.org ([95.142.160.155]:42284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXsb3-00086Z-Uk for 45474@debbugs.gnu.org; Sat, 17 Apr 2021 17:35:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1618695321; bh=TCuoFU+Km3d8h8HBfhm5t+kajxSxDwfMXWSJtdwVI74=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=D0ZdULUrTTzD6XemCdYLtzJ4KAKIicdvFMaQB54WGiT0snaq6adGZK2YJ2XhvXYLQ gFCDsJKYKcvh69ZpANCPvEzLo+vAhNQ19Gz3XdkxcMo2HLFusfgwTa+OsESl6Kc/Fe nG/lA4vCGfRxr+Ijs35KMH6xHVELud7xGwktIz0oUv6BzkthoQJ60o6g1HvRTpa87r 3v18sZ0jd9O1MTexOgCkaY0+SJTuGBLYpZsb6DkTymy081qQIsgUzbfSLDHDt+o7q9 Hi5KDWv/BBLctXet9449o0dTlG6/TGVVo5KGkJECV9fZSZLv9P29cFSrj+3TgMVrK1 XQ8QtiUNUj1dA== In-Reply-To: <87im4kzlfm.fsf@mail.linkov.net> 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:204272 Archived-At: > > Oh, I see it's a more fundamental problem: > Yes ;-) > > 1. completing-read-default let-binds minibuffer-completion-table to a > collection before calling read-from-minibuffer; > > 2. any nested call to read-from-minibuffer reuses the same value of > minibuffer-completion-table, even if it doesn't use completion; > Not necessarily, if another completion table has been set during the new minibuffer invocation. That's what happens with C-x C-f followed by C-x 8 RET. > > 3. icomplete checks for minibuffer-completion-table to decide whether to > activate icomplete completions in the minibuffer. > > This is how non-completion minibuffers get non-nil > minibuffer-completion-table. > > 'read-string' solves this problem by let-binding > minibuffer-completion-table to nil before calling read-from-minibuffer. > 'read-number' could do the same. But what about all other calls of > 'read-from-minibuffer'? They all can't be replaced with a new function > that will let-bind minibuffer-completion-table to nil. > You forgot one element of the problem: completing-read also uses read-from-minibuffer. So you cannot simply use read-from-minibuffer => no completions, completing-read => completions. > > I have no idea how to fix this. Maybe Stefan could help (Cc:ed). > What's wrong with my approach, which disables the completion backend on demand? A variant of it would be to add an eight argument to read-from-minibuffer. AFAICS it's only the caller that can know whether the completion backend should be used, IOW, the only thing that the completion backend can do is to obey the caller.