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: Fri, 23 Apr 2021 15:58:51 +0000 Message-ID: References: <3ed97a9c530093aca93d@heytings.org> <7dee3f4235d331cab291@heytings.org> <87r1jatd34.fsf@mail.linkov.net> <7dee3f423551aaf318cb@heytings.org> <87im4kzlfm.fsf@mail.linkov.net> <1869622e16546eafd9df@heytings.org> <871rb6np5j.fsf@mail.linkov.net> <87lf9cepqw.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="6172"; 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 Fri Apr 23 18:02:26 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 1lZyG9-0001Rp-MX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 18:02:25 +0200 Original-Received: from localhost ([::1]:59866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZyG8-0006YV-Kh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Apr 2021 12:02:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZyCr-0005HX-SU for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 11:59:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZyCr-00030i-L5 for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 11:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZyCr-0000qi-Jx for bug-gnu-emacs@gnu.org; Fri, 23 Apr 2021 11:59: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: Fri, 23 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.16191935353250 (code B ref 45474); Fri, 23 Apr 2021 15:59:01 +0000 Original-Received: (at 45474) by debbugs.gnu.org; 23 Apr 2021 15:58:55 +0000 Original-Received: from localhost ([127.0.0.1]:38639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZyCl-0000qL-7t for submit@debbugs.gnu.org; Fri, 23 Apr 2021 11:58:55 -0400 Original-Received: from heytings.org ([95.142.160.155]:50314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZyCj-0000qD-Jk for 45474@debbugs.gnu.org; Fri, 23 Apr 2021 11:58:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1619193532; bh=cfrdT3AzX8PSHJvTBv8oERmKOmITxiRrlQ0rHGhDdgU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=KcIH5IqycflRR0dT8EPsl5ANxMF0iLcp8YtWbmA9hNruarurZPMC3cO2z+9CsfT5t OZ1Mf8ZA4mTreEnfFCKAlZu88x086tRfOMa8rAxuMPYX+VdAiBuSLCJRxnbgdx3gAh /tE4jvg12DXRppTTN8C3eFdeXZISEPkIgWHwybQjapxmSEGReg76Zxhce7nU8B8fY7 k/tHkfVcaTuMU97euSDuDPRTG55W77Fnhn+qG3zJtvtL9gRLuz0Ruk2vIHjbGiFu6F TJLsPWuHgORQSCsqVqY6XDCOU09WQzld8zg4FVEf8soHYAKk+PmIkJLgG3xat+Ztl/ IuZ9gzSut38UA== In-Reply-To: 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:204746 Archived-At: Thanks for your detailed comments. >> By 'completing-read-default' _and_ by other completion backends that >> set minibuffer-completion-* elements and call read-from-minibuffer. >> Or am I misunderstanding something? > > AFAICT there are very few other pieces of code which let-bind (or set) > minibuffer-completion-*. And my suggested patch should hopefully not > affect them too significantly. Also I don't think we can fix this > problem without introducing corner-case incompatibilities and/or extra > code/changes in other frontends or backends. > Well, the fact that there were a few other pieces of code which do that was (at least as I understood it) part of the initial problem. And the purpose of the discussion (at least as I understood it) was to solve the current problem without breaking these few other pieces of code. >> If not, it means that your patch will fix the problem for >> completing-read-default, but not for other completion backends, who >> will have to resort on a similar trick to get the same effect. > > I think they'd need to make similar changes to fix the problem under > discussion in this longish thread, but they can keep using their old way > of working and the consequence will just be that they will keep > suffering from the old problem. > With my patch all they have to do is to add (minibuffer-local-completion t) before calling read-from-minibuffer. >> Not with the patch I'm proposing. What it does is the following (in >> abbreviated form): >> >> (let ((minibuffer-local-* minibuffer-completion-*)) >> (let ((minibuffer-completion-* nil)) >> (internal-read-from-minibuffer ...))) > > Not quite. The actual code is more like: > > (let ((minibuffer-local-* minibuffer-completion-*)) > [SOMETHING1] > (let ((minibuffer-completion-* nil)) > (internal-read-from-minibuffer ...)) > [SOMETHING2]) > > and those two [SOMETHINGn] still leak. > I admit that you lost me here. What are these [SOMETHINGn]'s, and why are they happening? Wasn't the point to not leak the minibuffer-completion-* variables? > > [ Another problem is that this approach breaks when you have > simultaneous active minibuffers, and the inner minibuffer is triggered > from the outer one (e.g. `C-x C-f` following by `C-h o`) since the > let-bindings above will (when run for the `C-h o`) temporarily override > the completion information of the outer minibuffer. This is not too > serious in the sense that it's no worse than what we have now, tho. ] > I won't comment on this, because I'm deeply saddened to see this happening. Emacs has had a nice Lisp-like stack of minibuffers forever, what the purpose of this new thing is is beyond me. > > You share the main downside of my proposal: `minibuffer-local-*` are now > only non-nil buffer-locally in the minibuffers. > > I mean it's good because it's what we want in the long term, but it's > bad because it's not backward compatible and there's probably some code > out there which will need to be adjusted to work with this. > I have to admit again that you lost me here. What do you mean? With my patch, inside the minibuffer, the minibuffer-local-* variables aren't used anymore, the usual minibuffer-completion-* variables are used, and they are buffer-local, so the sole and only thing that a piece of code wishing to use the new semantics needs to do is to let-bind (minibuffer-local-completion t) around the read-from-minibuffer call.