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: Sun, 18 Apr 2021 22:23:46 +0000 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: multipart/mixed; boundary="ocGwpE4YpI" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28416"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dario Gjorgjevski , 45474@debbugs.gnu.org, Juri Linkov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 00:24:13 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 1lYFpt-0007G9-16 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 00:24:13 +0200 Original-Received: from localhost ([::1]:41110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYFpr-0003nd-91 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Apr 2021 18:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYFpk-0003nW-6P for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 18:24:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYFpi-0004xS-9N for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 18:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYFpi-0005bn-5c for bug-gnu-emacs@gnu.org; Sun, 18 Apr 2021 18:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Apr 2021 22:24:02 +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.161878462921539 (code B ref 45474); Sun, 18 Apr 2021 22:24:02 +0000 Original-Received: (at 45474) by debbugs.gnu.org; 18 Apr 2021 22:23:49 +0000 Original-Received: from localhost ([127.0.0.1]:48012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYFpV-0005bL-Gg for submit@debbugs.gnu.org; Sun, 18 Apr 2021 18:23:49 -0400 Original-Received: from heytings.org ([95.142.160.155]:43902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYFpT-0005bC-Us for 45474@debbugs.gnu.org; Sun, 18 Apr 2021 18:23:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1618784626; bh=geBGSZWLrgRjUrr1QK8JWUFCsbbFbRSKARPy2mvNfpo=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=WcUFgB8USWA3NdsILws9d+OL6YuSYeWZI579SLbGMa+lBgrxjvCXZ7CqbxnK1Zqb1 18EwVgWwLTQBOPe9NpZP3gaMNa5PgKnrvWYliS5IiBHLElHnAc3H/bUU/dhb07oZJA c8XWDuWTEc5BrztR9cpAD4dBBykHP6l9dwjIa2phMF0WSdPvZ8oZllRed90kwzjcKV apaU8QaL7gcn6BTXirQLwJSIM3vj8G5KcoKKKfrnkbeAh2yJKaz9qoc46HWBPc7bJf z08vYoyBsWAnjuaj628iq8STtT4RPEkLjO9jkjNIEHHI9NuxLrLn0VkOI04ak9ndec q/y/valskX+5w== In-Reply-To: Content-ID: 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:204415 Archived-At: --ocGwpE4YpI Content-Type: text/plain; charset=us-ascii; format=flowed Content-ID: >> See the attached patch. I's a draft, as I said >> read-from-minibuffer-simple could probably renamed to something more >> elegant, and (at least some of) the other calls to read-from-minibuffer >> could be replaced by the macro. > > Ah, I see. But that's based on "blacklisting" those places that don't > want to use minibuffer-completion-table, so it requires changes in many > places (including outside of Emacs's codebase). > It would be possible to use whitelisting instead by renaming the current read-from-minibuffer to internal-read-from-minibuffer, which would be wrapped in a macro read-from-minibuffer. The change would be transparent, except for those places (e.g. completing-read-default) where what we actually want is to use internal-read-from-minibuffer. But this change would be slightly more invasive than what follows. >> These are yet other possible approaches indeed, but it seems to me at >> first sight that they are more complex than the solution I suggest. > > The patch below shows one way to do what I suggest. > Thanks. Somehow I feel that using the keymap to decide whether the completion table should be used isn't safe enough, it's possible (at least in theory) that a minibuffer with a certain keymap uses completion tables and another one using the same keymap does not. ISTM that it's safer (and more explicit) to use the current minibuffer depth for that purpose; see attached patch. > > Just like your approach, I think this is only a temporary fix until we > can solve the problem for real by making `minibuffer-completion-table` > buffer-local > I'm not sure I fully understand why this is necessary, but is "Fmake_variable_buffer_local (Qminibuffer_completion_table);" just after "if ... specbind (Qminibuffer_completion_table, Qnil);" not enough for this? --ocGwpE4YpI Content-Type: text/x-diff; name=Make-it-possible-to-disable-completion-in-recursive-.patch; charset=us-ascii Content-Transfer-Encoding: base64 Content-ID: Content-Description: Content-Disposition: attachment; filename=Make-it-possible-to-disable-completion-in-recursive-.patch RnJvbSA0NjU0YzUyNTFjYWI2NzAzZTRkY2Q5NGVjYWE5MDBiYjk3MGJiNTg5 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBTdW4sIDE4IEFw ciAyMDIxIDIyOjE1OjA4ICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIE1ha2Ug aXQgcG9zc2libGUgdG8gZGlzYWJsZSBjb21wbGV0aW9uIGluIHJlY3Vyc2l2 ZQ0KIG1pbmlidWZmZXJzDQoNCi0tLQ0KIGxpc3AvbWluaWJ1ZmZlci5lbCB8 ICAxICsNCiBzcmMvbWluaWJ1Zi5jICAgICAgfCAxNSArKysrKysrKystLS0t LS0NCiAyIGZpbGVzIGNoYW5nZWQsIDEwIGluc2VydGlvbnMoKyksIDYgZGVs ZXRpb25zKC0pDQoNCmRpZmYgLS1naXQgYS9saXNwL21pbmlidWZmZXIuZWwg Yi9saXNwL21pbmlidWZmZXIuZWwNCmluZGV4IGM5MDBiMGQ3Y2UuLjk5MWVk OWRjOTMgMTAwNjQ0DQotLS0gYS9saXNwL21pbmlidWZmZXIuZWwNCisrKyBi L2xpc3AvbWluaWJ1ZmZlci5lbA0KQEAgLTM4MjUsNiArMzgyNSw3IEBAIGNv bXBsZXRpbmctcmVhZC1kZWZhdWx0DQogICAgIC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