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#45474: Icomplete exhibiting in recursive minibuffer when it =?UTF-8?Q?shouldn=E2=80=99t?= Date: Mon, 19 Apr 2021 11:57:59 -0400 Message-ID: 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> <1869622e16546eafd9df@heytings.org> <1869622e16dc36c3f2fd@heytings.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="7479"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Dario Gjorgjevski , 45474@debbugs.gnu.org, Juri Linkov To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 17:59:25 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 1lYWJ1-0001n0-N6 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 17:59:24 +0200 Original-Received: from localhost ([::1]:44498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYWJ0-0004Aq-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 11:59:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYWIi-0004A5-D9 for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:59:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYWIf-0005wM-UF for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYWIf-0001yh-TU for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:59: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: Mon, 19 Apr 2021 15:59: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.16188478967542 (code B ref 45474); Mon, 19 Apr 2021 15:59:01 +0000 Original-Received: (at 45474) by debbugs.gnu.org; 19 Apr 2021 15:58:16 +0000 Original-Received: from localhost ([127.0.0.1]:51812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYWHw-0001xa-DQ for submit@debbugs.gnu.org; Mon, 19 Apr 2021 11:58:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYWHu-0001xJ-5t for 45474@debbugs.gnu.org; Mon, 19 Apr 2021 11:58:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 065231002F2; Mon, 19 Apr 2021 11:58:02 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7E5861000D0; Mon, 19 Apr 2021 11:58:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1618847880; bh=njcG1WtMp6noiw2sXQN58IZGnpbv7Wf+hk8kL5T6hHw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=crvHLPxS1Cgqp9/aJKOUpVkUWBG7pMoDMxH9q/9Kv1Ikj8lPB1Hu3zJnpaGO3QJ0A vUpn53OTqsV7wuB+Jk4ht/kDietaeO2Flk+9gnfss55NWkVOzBLzMNu3R+doQJAaer YL0U90fwFvRmhGvPyOeA8ly6gfDNyHT/pvnPzq8IAl6Jrwv+DmgUqYeXs9w9NuToPA 96csv8cICbkgVUMFyt8SuGCINU6RcsKUgTRJr6sNqeM0agiSnSZibjcv1qN8dn13Cy 2zF03o7noevLvYFwb+5tXNT9o/8NWwE/aZP21g6+YoWbdQO9M5oZ6RcArIchSQrMqy iBk68eyx1oPWA== Original-Received: from alfajor (104-222-126-84.cpe.teksavvy.com [104.222.126.84]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34E8E12026E; Mon, 19 Apr 2021 11:58:00 -0400 (EDT) In-Reply-To: (Gregory Heytings's message of "Mon, 19 Apr 2021 12:14:18 +0000") 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:204479 Archived-At: > There are 76 calls to read-from-minibuffer on ELPA. AFAICS, the only call > that uses minibuffer-completion-table is the one iside ivy-read. [...] > There are 903 calls to read-from-minibuffer on MELPA. AFAICS, only > a handful of them (yatex, gams-mode, python-django, magit) use > minibuffer-completion-table. The case of Magit is interesting: it solves > the current problem by defining two functions, > magit-completing-read-multiple that let-binds minibuffer-completion-table to > the appropriate value, and magit-read-string that let-binds > minibuffer-completion-table to nil. [ Thanks for the footwork. ] So the whitelist approach we're considering would break and few cases like `ivy-read`, and `magit-completing-read-multiple` and would fix the corner case misbehavior in hundred of other calls. The blacklist approach would instead not break anything but would require adding extra code to a few hundred places to fix those corner case misbehaviors. I'm starting to feel that neither option is very attractive. I think we should: - Do something along the lines of the whitelist approach, as the "long term" solution. - Add to it some "short term" heuristic (e.g. using something like the "equal keymap" or the minibuffer depth) that keeps it working for ivy-read and friends, maybe emitting a warning along the way (and with a clean way to silence this warning when it's a false positive) so we can remove the heuristic in Emacs-30. WDYT? >> No, I meant that instead of using let-binding to set the var, we'd use >> `setq-local`. This requires the code to run from within the minibuffer, >> contrary to the current situation where the let-binding takes place >> outside of the minibuffer. > Yes, I understood this, but the effect of let-binding the var and make it > buffer-local after the minibuffer has been created but before the > minibuffer-setup-hook is executed is the same. Or am I missing something? [ Note: I consider this part of the discussion as not directly relevant to bug#45474. ] Oh, so `read-from-minibuffer` receives it as an "implicit argument" vet dynamically scoped let-binding and then sets it buffer locally? That sounds like a potentially good halfway point, so code which (incorrectly) uses `minibuffer-completion-table` from non-mini buffers will still usually get the right table (e.g. when there's only one minibuffer active). > If not, this would solve the problem without breaking anything (as the > global value of minibuffer-completion-table would not change). Exactly. Stefan