From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#72176: 30.0.60; icomplete-vertical-mode failed to work with Error Date: Sun, 21 Jul 2024 05:27:43 +0300 Message-ID: <384a9697-275c-4d0b-96a5-3741b3883696@gutov.dev> References: <86cynag9db.fsf@gnu.org> <874j8mc1b7.fsf@gmail.com> <87le1ybwh3.fsf@gmail.com> <868qxyg1dg.fsf@gnu.org> <87h6clc0nu.fsf@gmail.com> <86wmlgegyr.fsf@gnu.org> <86ttgkcqtc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18927"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: rpluim@gmail.com, Stefan Monnier , visuweshm@gmail.com, 72176@debbugs.gnu.org, aqua0210@foxmail.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Eshel Yaron , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 21 04:28:37 2024 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 1sVMJP-0004jK-FJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Jul 2024 04:28:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVMJ4-0000eW-3o; Sat, 20 Jul 2024 22:28:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVMIt-0000aY-3K for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 22:28:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVMIq-0006bN-KC for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 22:28:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sVMIr-0007b7-LZ for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 22:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jul 2024 02:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72176 X-GNU-PR-Package: emacs Original-Received: via spool by 72176-submit@debbugs.gnu.org id=B72176.172152887629193 (code B ref 72176); Sun, 21 Jul 2024 02:28:01 +0000 Original-Received: (at 72176) by debbugs.gnu.org; 21 Jul 2024 02:27:56 +0000 Original-Received: from localhost ([127.0.0.1]:54576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVMIm-0007an-4k for submit@debbugs.gnu.org; Sat, 20 Jul 2024 22:27:56 -0400 Original-Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]:52425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVMIk-0007aX-7D for 72176@debbugs.gnu.org; Sat, 20 Jul 2024 22:27:55 -0400 Original-Received: from compute8.internal (compute8.nyi.internal [10.202.2.227]) by mailfhigh.nyi.internal (Postfix) with ESMTP id A454411401C3; Sat, 20 Jul 2024 22:27:47 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute8.internal (MEProxy); Sat, 20 Jul 2024 22:27:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1721528867; x=1721615267; bh=honTuZMDQjKQAoL9svo7glhMqgTjNOezIiHfIIjRFTw=; b= Wv02ZmPsc9gYnn4bYguALrWhyEKD6fpj7T2aDhPZjWwA/k+L2noblsuPdXxnqViP rvJ+HubdEUQa9fXSGpJTk0Vd5Gl6Sb8bzd9Y6dAV/MVFtDbIc5UJYNKrtVFEGe3d dDQw5m80sq9bnFy2kkqCA2U8na6ZCJ7DktgoUpJpyxHPUAbJxJSFjv6TJpSE1IPj XUy+PVuGocdS9ybE5P0kGDX/5UU52pDAqPtC2Ufb4cpwbyD+P1Ih0bXPRSbzhele ppj1TD+glxk7suy4PTVWWfhrYxC1J0KbdjeCbnj1qsT85DCCCyV+GWRQSKqwkwdp IHPYxE4mbES71nYyrnexWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1721528867; x= 1721615267; bh=honTuZMDQjKQAoL9svo7glhMqgTjNOezIiHfIIjRFTw=; b=X 4PtIMdWb2PTTLgdEa9xFbiwYrs2Ii1EUr2k1luFSdZ+4XtyIAg3XR4zuzQbgleDR /qBwtyT3IsEubNRTbLZypgTLnzUij28lDF5mTNuUA5glcf3y80QbN8Qg+8OReDhC 2eU3fit+WAyKpofrXkAwc3o4vyq7sSnmiww3LlWOw1sD5KYhEkz2v0+zNjYKsBZV NTOIcbx29K/BWGD72bfFm9H4RxTM3261nh8ujmcBOP5hHsN8VQD66yp/Ms4rsyCC Z5DjAUUZLrypADOljZvILxMz4gg+xppKhKMj99EsDgn0S2yfOLfsRb6CAMZu1tfO WdVskAWZazskPM/Su2fDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrheeggdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeegleefteekgffhvdfhtdegveevveetteegteevgeettdehhfdukeetheffueek keenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Jul 2024 22:27:44 -0400 (EDT) Content-Language: en-US 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289053 Archived-At: Hi Eshel, On 20/07/2024 19:48, Eshel Yaron wrote: > Eli Zaretskii writes: > >>> From: João Távora >>> Date: Sat, 20 Jul 2024 10:09:38 +0100 >>> Cc: Robert Pluim , 72176@debbugs.gnu.org, aqua0210@foxmail.com, >>> visuweshm@gmail.com >>> >>> On Sat, Jul 20, 2024 at 7:05 AM Eli Zaretskii wrote: >>> >>>> Adding João, who I think wrote this code. >>> >>> Don't understand root cause, but it's in the whereabouts of >>> the current analysis, yes. I recall regexp is supposed to always >>> match, because it has (presumably) been used for a previous >>> filtering. This breakage would seem to be a consequence of >>> 3b07d33059150 by Eshel Yaron which in turn seems to be fixing >>> something stemming from some feature Dmitry added in >>> 6b7ff60a5e71c in June. I went one commit before that one and >>> the recipe didn't break. >> >> Thanks, I'm adding the guilty parties to this discussion. > > I'm afraid you missed your mark, because AFAICT it is Stefan Monnier > that's behind the root cause of this issue, which goes back way before > Dmitry's change or mine :) Thanks for investigating! It might or might not be considered a bug (the behavior had been working out okay before our changes), but your proposal does make it more consistent, so I hope we can use it. vc-annotate for lines in question points to commit 86957a0cd which references bug#11714. I _haven't_ been able to reproduce it with them commented out now - my guess it's because of the file-name-quote operation that had been added much later (the last comment in the bug mentions that functionality as a hypothetical). So maybe they really are unnecessary now. Though the quoting-unquoting-requoting stuff is pretty gnarly, so it'd be great to get a go-ahead from Stefan as well. > It is a bug in completion--sifn-requote, that leads to incorrect > completion strings to be passed to completion-lazy-hilit. It is not > related to icomplete per se. To see the issue, try the following: > > 1. emacs -Q > 2. say C-x C-f, clear the minibuffer, and insert ~/.config/~/f > 3. hit ? to pop the completions list > 4. see something like: > > --8<---------------cut here---------------start------------->8--- > Click or type M-RET on a completion to select it. > Type M- or M- to move point between completions. > > 6 possible completions: > .config/~/foo.json .config/~/foo.org .config/~/foo.php > .config/~/foo.py .config/~/foo.py~ .config/~/foo.rs > --8<---------------cut here---------------end--------------->8--- > > Note the incorrect prefix ".config/~/", completions should appear as > "foo.json", "foo.org", etc. > > The following diff fixes this for me (including the icomplete symptom), > although I can't claim to fully understand completion--sifn-requote yet: > > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 31c365bf850..d0eb6b43c80 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -3855,13 +3855,13 @@ completion--sifn-requote > ;; Second assumptions: If qpos is far from the end this can be a bit slow, > ;; so we speed it up by doing a first loop that skips a word at a time. > ;; This word-sized loop is careful not to cut in the middle of env-vars. > - (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr))) > - (and boundary > - (progn > - (setq qprefix (substring qstr 0 boundary)) > - (string-prefix-p uprefix > - (substitute-in-file-name qprefix))))) > - (setq qstr qprefix)) > + ;; (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr))) > + ;; (and boundary > + ;; (progn > + ;; (setq qprefix (substring qstr 0 boundary)) > + ;; (string-prefix-p uprefix > + ;; (substitute-in-file-name qprefix))))) > + ;; (setq qstr qprefix)) > (let ((qpos (length qstr))) > (while (and (> qpos 0) > (string-prefix-p uprefix