GNU bug report logs - #48356
28.0.50; choose-completion discards the suffix after the completion boundary

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Daniel Mendler <mail@HIDDEN>; dated Tue, 11 May 2021 17:24:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 18 Apr 2024 14:25:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 18 10:25:24 2024
Received: from localhost ([127.0.0.1]:52736 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rxShX-00069U-KJ
	for submit <at> debbugs.gnu.org; Thu, 18 Apr 2024 10:25:24 -0400
Received: from mxout6.mail.janestreet.com ([64.215.233.21]:53589)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1rxShU-00068S-Of
 for 48356 <at> debbugs.gnu.org; Thu, 18 Apr 2024 10:25:22 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
In-Reply-To: <11a8e438-128d-47b3-ae6f-c3ce48bb902b@HIDDEN> (Dmitry Gutov's
 message of "Mon, 15 Apr 2024 02:55:35 +0300")
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN>
 <865xwov165.fsf@HIDDEN>
 <3833acf2-704e-486b-8e33-54cddf26adc9@HIDDEN>
 <86le5f99ml.fsf@HIDDEN>
 <11a8e438-128d-47b3-ae6f-c3ce48bb902b@HIDDEN>
Date: Thu, 18 Apr 2024 10:25:01 -0400
Message-ID: <ierplumbveq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1713450301;
 bh=KP6nZwYnfpWc32No/Clh68EuUsYF8SwdnebKP50WmsA=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=lZqxMsgEb1xs9ZuCoklrB53v2Er3+/YS94gw/a6ofi3tPWnCxbvotuoS0/pFaxA2u
 tKorXlarqQVvTjUusXUGg5FYGTCaGDPmQqebzCP5OG+2RW3IpNTgEDJUlKfwxgnOKk
 LxKVOfLA8DCbgTM0j3qT4Pf3jeY3BuAxm5b5ynamfOh03F3sxnrsRG9VOW6i06VzDW
 dKl9gzUtzUJLq8kaOGR2bBgSehA/eEDqY8WTzNg6fhL7bPyn/GAent++CHCqSUo89o
 lyqCkug5da4rmr/kNL7DEUSAff5tZSjiLxG3SXUp1n9LnMqq0y8+i8LjLgAsztNXDa
 gAGJEtOcEyPhg==
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: mail@HIDDEN, Juri Linkov <juri@HIDDEN>,
 48356 <at> debbugs.gnu.org, monnier@HIDDEN, jdtsmith@HIDDEN,
 Visuwesh <visuweshm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Dmitry Gutov <dmitry@HIDDEN> writes:
> Hi Juri,
>
> On 14/04/2024 19:44, Juri Linkov wrote:
>>> As one downside, it brings back behavior described in
>>> https://debbugs.gnu.org/34517#14. That doesn't seem too critical to me, but
>>> opinions might vary.
>> Sadly, this is quite an important case.  Recently Spencer implemented
>> a way to deselect a candidate in the visible completions list
>> (minibuffer-visible-completions=t) when the user starts typing
>> in the minibuffer.
>
> I think the (admittedly pretty cool) minibuffer-visible-completions
> feature is orthogonal: the scenarios I'm considering and trying to fix
> here also involve selecting a completion from *Completions* in some
> way (e.g. using M-up or M-down followed by M-RET, in default
> configuration). And this is currently working worse for in-buffer
> completion than for minibuffer completion WRT keeping the suffix
> around.

Yes, e.g.:

1. emacs -Q
2. M-x shell
3. mkdir -p dir1 dir2 && touch dir1/foo dir2/foo
4. cat dir/foo TAB
5. *Completions* contains: 2 possible completions: dir1/ dir2/
6. Click "dir1/"
7. The buffer now contains "cat dir1/", the "foo" has been deleted

This is a bug, but moreover it's also inconsistent with minibuffer
completion, e.g.:

8. C-x C-f dir/foo TAB
9. *Completions* contains: 2 possible completions: dir1/ dir2/
10. Click "dir1/"
11. The minibuffer now contains "dir1/foo"

We should make them both behave the same way.

>> But then the user could change the mind
>> and still select a candidate.  This would interfere with the
>> contents of the minibuffer.
>
> Suppose they do. But the list of completions they're shown is for an
> outdated input. Does it really make more sense to erase the current
> input than to insert the completion where it was supposed to go?

Yeah, this patch changes the behavior in the case of an outdated
*Completions* buffer, and the new behavior is buggy, but I think the old
behavior was also buggy and the new behavior is better.

Example: In emacs -Q, if I type

C-x C-f ~/src/emacs/emacs-2 <TAB>

I get completions "emacs-28" and "emacs-29"

Suppose I then type /src (without hitting tab or updating the
*Completions* buffer) so that the minibuffer contains:

~/src/emacs/emacs-2/src

Then I click on one of the completions to choose it.

Before this patch the minibuffer will contain:

~/src/emacs/emacs-28/

and after this patch it will contain

~/src/emacs/emacs-28//src

Both of these are wrong IMO, but IMO the second one is closer to
correct, and it's more consistent with the normal case (when
*Completions* is up to date) and with in-buffer completion behavior, so
I think this patch is an improvement and could be installed.

Still, maybe we can get it to the point where clicking on an outdated
completion makes the minibuffer contain

~/src/emacs/emacs-28/src

instead?  Which I think is the correct behavior.

But I don't think we need to do that before landing this patch.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 14 Apr 2024 23:56:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 14 19:56:00 2024
Received: from localhost ([127.0.0.1]:36391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rw9hY-00018I-0l
	for submit <at> debbugs.gnu.org; Sun, 14 Apr 2024 19:56:00 -0400
Received: from wfhigh4-smtp.messagingengine.com ([64.147.123.155]:54969)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rw9hW-000172-2L
 for 48356 <at> debbugs.gnu.org; Sun, 14 Apr 2024 19:55:58 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfhigh.west.internal (Postfix) with ESMTP id 3AB6C180010E;
 Sun, 14 Apr 2024 19:55:40 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Sun, 14 Apr 2024 19:55:40 -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=1713138939;
 x=1713225339; bh=tuGONOkhXDTbCLpZiskZ1GuQZ/bCbKlxqZJ8aqYaFBY=; b=
 MjrZoZjytwo35pbR3+LRKBVPf0ootCuSw9ovMpi+WJMorQLWCHTj03N1zgDoPlTN
 Wi6WGzjPBKrZpBQ1+47hgl52L4wnpyAmbYjzAITzUSb3pn7L7FAh0DGm0un39NeP
 GpCp9v2gXsiS5EE1VVg7InabxNPH5d2TKTmeq4wI8lkt8vOqLcY95IusB2Y4DJ/6
 u5pSh2V3PV7e4Miz9TwqTjTJFrvS0fQqeTNieGrMMzmtioF87qzg362xW+7YpZF5
 JXR5EhuspO8mXVmvaYagBwrY6KJRnkkOxKedeop78zr8X5eomY1Xn8163FmVLlFz
 yaRd/IpanCZl7yojdWY+2w==
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=fm2; t=1713138939; x=
 1713225339; bh=tuGONOkhXDTbCLpZiskZ1GuQZ/bCbKlxqZJ8aqYaFBY=; b=G
 wi7M6mbkNWvi4bBAmjK3tuRzRIrXu4qI+UhOnWjXktcn+ES6bAAAIBUaLgq7MQqn
 fygdd0J0bnvCH4meQx7ZvqbXBQSRQw2npxheABc6zdMPa65zYjDOgzThxsgiOerW
 WJDecq0hic08qvPNik2lD8xZGa/02FQwZwkKy6mQ9+F9emcn+A4B5O/++z1qUWhI
 CtIE/yWiBv2Z2hfgPAMsXgaPCffnw1mk3tr32lvReilR+Z8IelyiYWEVxOD/LKPK
 bVY+j6KZKOe5+tHI5ky/0CzXq8vCKh6ORKlowctaE/DxAyBgpfjAitGGfJmp/2LZ
 7fmlpN2OWEfql47c0hy9A==
X-ME-Sender: <xms:-2wcZrZ_z0JjOS-fi9maliA8cdHpNsR-WE_Okm0hYkqsn6-7EDyejQ>
 <xme:-2wcZqYA1bYa73zqIQ4lg341TMC-Pp773f7St5NwPJtJyJS-YvUk_PEyk0Se5MyKq
 NaOAYPa1uqkvokKzkU>
X-ME-Received: <xmr:-2wcZt_CrrvxmT9LZ4zEAQNVex4Ou6Ll8ug_iSTGz9akgpZO4kj0vT1_V1wZ7vp-k3rt>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejtddgudefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepffeifedvleeukedtgfelieegudfgveekfeejveejffetffeuueeugefhveei
 uddvnecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc
 frrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:-2wcZhq_9Dh4_IExp4i1J2wv4xZrT2XB3DAiNVEMvHaBwFXyupxlKw>
 <xmx:-2wcZmp-Ihhf-Oq9gSVgFySF9JkAOKOwLz7kFD47QyNl_akWmd7kLg>
 <xmx:-2wcZnSr4Tpfy4LUeQ5-1bHCUGtvz5bxKfhhPTorIin5KxZNMZ-gjg>
 <xmx:-2wcZurJretB8WSbI5ixFzYNOj8mAqMk0zbonBJulxtOmitqNR0TnA>
 <xmx:-2wcZichoCk3K_E6fOpDRPsb--tuoEFrOFa88sZRZkCYyKNmMp2Xb71T>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 14 Apr 2024 19:55:37 -0400 (EDT)
Message-ID: <11a8e438-128d-47b3-ae6f-c3ce48bb902b@HIDDEN>
Date: Mon, 15 Apr 2024 02:55:35 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN> <865xwov165.fsf@HIDDEN>
 <3833acf2-704e-486b-8e33-54cddf26adc9@HIDDEN>
 <86le5f99ml.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <86le5f99ml.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: Spencer Baugh <sbaugh@HIDDEN>, mail@HIDDEN,
 48356 <at> debbugs.gnu.org, monnier@HIDDEN, jdtsmith@HIDDEN,
 Visuwesh <visuweshm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Juri,

On 14/04/2024 19:44, Juri Linkov wrote:
>> As one downside, it brings back behavior described in
>> https://debbugs.gnu.org/34517#14. That doesn't seem too critical to me, but
>> opinions might vary.
> Sadly, this is quite an important case.  Recently Spencer implemented
> a way to deselect a candidate in the visible completions list
> (minibuffer-visible-completions=t) when the user starts typing
> in the minibuffer.

I think the (admittedly pretty cool) minibuffer-visible-completions 
feature is orthogonal: the scenarios I'm considering and trying to fix 
here also involve selecting a completion from *Completions* in some way 
(e.g. using M-up or M-down followed by M-RET, in default configuration). 
And this is currently working worse for in-buffer completion than for 
minibuffer completion WRT keeping the suffix around.

> But then the user could change the mind
> and still select a candidate.  This would interfere with the
> contents of the minibuffer.

Suppose they do. But the list of completions they're shown is for an 
outdated input. Does it really make more sense to erase the current 
input than to insert the completion where it was supposed to go?

The problem here, from my POV, is that we currently have a solution 
which matches the above goal, but which only makes sense for minibuffer 
(I think you wouldn't store the before/after buffer contents in separate 
string variables the same way). Whereas the API used is the same, so it 
would really make sense to minimize the differences in behavior between 
minibuffer and in-buffer completion.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 14 Apr 2024 16:46:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 14 12:46:49 2024
Received: from localhost ([127.0.0.1]:36091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rw30D-0006Cb-HE
	for submit <at> debbugs.gnu.org; Sun, 14 Apr 2024 12:46:49 -0400
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:39489)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1rw30B-0006CC-Ve
 for 48356 <at> debbugs.gnu.org; Sun, 14 Apr 2024 12:46:48 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 34851E0002;
 Sun, 14 Apr 2024 16:46:28 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
In-Reply-To: <3833acf2-704e-486b-8e33-54cddf26adc9@HIDDEN> (Dmitry Gutov's
 message of "Fri, 12 Apr 2024 00:59:27 +0300")
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN>
 <865xwov165.fsf@HIDDEN>
 <3833acf2-704e-486b-8e33-54cddf26adc9@HIDDEN>
Date: Sun, 14 Apr 2024 19:44:50 +0300
Message-ID: <86le5f99ml.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: Spencer Baugh <sbaugh@HIDDEN>, mail@HIDDEN,
 48356 <at> debbugs.gnu.org, monnier@HIDDEN, jdtsmith@HIDDEN,
 Visuwesh <visuweshm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> As one downside, it brings back behavior described in
> https://debbugs.gnu.org/34517#14. That doesn't seem too critical to me, but
> opinions might vary.

Sadly, this is quite an important case.  Recently Spencer implemented
a way to deselect a candidate in the visible completions list
(minibuffer-visible-completions=t) when the user starts typing
in the minibuffer.  But then the user could change the mind
and still select a candidate.  This would interfere with the
contents of the minibuffer.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 11 Apr 2024 21:59:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 11 17:59:55 2024
Received: from localhost ([127.0.0.1]:57449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rv2SW-0007Kr-MD
	for submit <at> debbugs.gnu.org; Thu, 11 Apr 2024 17:59:54 -0400
Received: from fout5-smtp.messagingengine.com ([103.168.172.148]:40819)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rv2SR-0007JV-Ci
 for 48356 <at> debbugs.gnu.org; Thu, 11 Apr 2024 17:59:50 -0400
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailfout.nyi.internal (Postfix) with ESMTP id 936F6138029F;
 Thu, 11 Apr 2024 17:59:32 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute3.internal (MEProxy); Thu, 11 Apr 2024 17:59:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc: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=1712872772; x=1712959172; bh=KWf4QC/1Uh
 KLJeto02XvgIg36cVf7xQju8QChV6k938=; b=A8lP3Oc2tGcOwBPrr+9aJpT8/l
 5W0OOtG6kFkfWBi2jbLHfRHrCsyBA3uqZkiHlNTaV+Xf5StTSXi5CgmCtnPIgFV8
 LmoV4WJ54KgmKO9I0Lq/Xf6O9ainyXIM0NGpIEgJhricbm6krjko6swWd2RUbTzq
 NAM60BaBDO1MPeq4DiQ0KiVx/iIKV+7vUtJ+/+Aumz8CNP+FgIW2TLS64yJXVfSE
 pcOhp5SF8hTupX3+3XJFVPguFa5nv9VtKoUJI5Ilc1g3sr1QRwxjxFzaoOQBKMhH
 8xkzNnFi+PpFK6RT0a/ltEyWX5+HZYE6FXhZjgB1K+o/o4CZNjVvIHuWJ+2Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc: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=
 fm2; t=1712872772; x=1712959172; bh=KWf4QC/1UhKLJeto02XvgIg36cVf
 7xQju8QChV6k938=; b=JX8jrwaYsPXwB4bA2SkzEfz6Q5DYq0E5BGKMU9YabuyP
 vv0dUmkZYTLwlMoJk+orJ3DQEvQGJ2VXe/9bIkpJlNGDKudmYIimftjKJyG9AF6X
 rHjv04ad91cobW0AuIAJGFPHhQWScUniujeAIy+/rFVGQFuEHEGum6mHLcEu0m5m
 Ogpbzuha5jFSrhg0a9uwIdNfSUCBLLouXsqDj8oPmQKks44y3zSFTrOLYoTeDnCO
 JJiGr+LeDBDUEKZevExpMbrRbFlFTnICXZuPl05EBgOkk8A77rj+TrJkv9/N1Fku
 jK5T40KiIiA3pDWWqAaCihdB/6T1IPIxCyj1OZlR2g==
X-ME-Sender: <xms:Q10YZsoX3LWs_xcAg0k0BAV0imuo3G0U10OSnCN5CEyf96EgRvdwjQ>
 <xme:Q10YZiq5Q47c-vw0_nUP_ckW9BqQCr8LCeqYoLesofde4sWVSlLznv-_uUxYPrSGf
 K04FM-MuIIf0679_kA>
X-ME-Received: <xmr:Q10YZhPrSYEYnAKzxX_Qa9BZrmpgSo-Sn4fHWtJosyrFzGgKcfgFSjtgAh6roZM82bl3>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehledgtdeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeenucfhrhhomhepffhmihht
 rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth
 gvrhhnpeelkeejiedvffdtgeejvdffffelueelkefhtdekjeehuefgteduheegfefhieek
 jeenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf
 grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:RF0YZj6VE-oO5mJsYgFAWhJS4A7dNAkbWL5Fqyd9UIASh3_qfPu_GA>
 <xmx:RF0YZr4D2NfwTjOx8NVR2bW3WaUM7gENjd6GidC3lmucwBoECGLlpw>
 <xmx:RF0YZjjoZLJKLziL6nLWskr04RqmDagPm2U7fgMdrsLdG6BZCnPO_Q>
 <xmx:RF0YZl7B1rMCTXCwD0MEYEB2GEWgR9NYaGRRDp5jNPbpILvQ2Ngc8w>
 <xmx:RF0YZubhFUA8ZsR-jCkIHQnHq2tNQy9qjWryQj39JUVXRyoJL2VDaDFR>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 11 Apr 2024 17:59:30 -0400 (EDT)
Content-Type: multipart/mixed; boundary="------------08ARVNJ9AakF0UST5Z0Szv0r"
Message-ID: <3833acf2-704e-486b-8e33-54cddf26adc9@HIDDEN>
Date: Fri, 12 Apr 2024 00:59:27 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN> <865xwov165.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <865xwov165.fsf@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: mail@HIDDEN, juri@HIDDEN, 48356 <at> debbugs.gnu.org,
 monnier@HIDDEN, jdtsmith@HIDDEN, Visuwesh <visuweshm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------08ARVNJ9AakF0UST5Z0Szv0r
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 11/04/2024 09:55, Eli Zaretskii wrote:
>> Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
>>   JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
>> Date: Thu, 11 Apr 2024 04:00:35 +0300
>> From: Dmitry Gutov <dmitry@HIDDEN>
>>
>> All right, please see the new function completion-base-suffix added in
>> 0288bc6c949. Any docstring improvements (and others) are welcome.
> 
> I tried to do that.
> 
> Is there any reason why this function shouldn't be called
> completion-boundary-suffix instead?
> 
>> I guess we should also mention it in NEWS...
> 
> Yes, please.

Sorry about the trouble, here is the next patch on top which essentially 
had to change the function's semantics to match the name above, except 
it needed just the length. Since that made it a very thin wrapper, I'm 
inlining the code back, no docstring or announcement needed.

What else this patch does:

* Removes the variables completion-use-base-affixes and 
completion-base-affixes, just using the completion-base-position 
variable, although with a marker for the field end.
* Changes 'completion--replace' to preserve the said marker.

The result is that the text outside of the current field boundaries is 
maintained for both minibuffer and in-buffer completion (in particular, 
the suffix).

As one downside, it brings back behavior described in 
https://debbugs.gnu.org/34517#14. That doesn't seem too critical to me, 
but opinions might vary.

So more feedback welcome.

Also Cc'ing Visuwesh who filed bug#49931 (related).
--------------08ARVNJ9AakF0UST5Z0Szv0r
Content-Type: text/x-patch; charset=UTF-8; name="base-suffix-v3.diff"
Content-Disposition: attachment; filename="base-suffix-v3.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2xpc3AvbWluaWJ1ZmZlci5lbCBiL2xpc3AvbWluaWJ1ZmZlci5lbApp
bmRleCBhZDZhMDkyOGNkYS4uNTY4MjdmNTA5YWEgMTAwNjQ0Ci0tLSBhL2xpc3AvbWluaWJ1
ZmZlci5lbAorKysgYi9saXNwL21pbmlidWZmZXIuZWwKQEAgLTExMiwyMCArMTEyLDYgQEAg
Y29tcGxldGlvbi1ib3VuZGFyaWVzCiAgICAgKGNvbnMgKG9yIChjYWRyIGJvdW5kYXJpZXMp
IDApCiAgICAgICAgICAgKG9yIChjZGRyIGJvdW5kYXJpZXMpIChsZW5ndGggc3VmZml4KSkp
KSkKIAotKGRlZnVuIGNvbXBsZXRpb24tYmFzZS1zdWZmaXggKHN0YXJ0IGVuZCBjb2xsZWN0
aW9uIHByZWRpY2F0ZSkKLSAgIlJldHVybiBzdWZmaXggb2YgY29tcGxldGlvbiBvZiBidWZm
ZXIgdGV4dCBiZXR3ZWVuIFNUQVJUIGFuZCBFTkQuCi1DT0xMRUNUSU9OIGFuZCBQUkVESUNB
VEUgYXJlLCByZXNwZWN0aXZlbHksIHRoZSBjb21wbGV0aW9uJ3MKLWNvbXBsZXRpb24gdGFi
bGUgYW5kIHByZWRpY2F0ZSwgYXMgaW4gYGNvbXBsZXRpb24tYm91bmRhcmllcycgKHdoaWNo
IHNlZSkuCi1WYWx1ZSBpcyBhIHN1YnN0cmluZyBvZiBidWZmZXIgdGV4dCBiZXR3ZWVuIHBv
aW50IGFuZCBFTkQuICBJdCBpcwotdGhlIGNvbXBsZXRpb24gc3VmZml4IHRoYXQgZm9sbG93
cyB0aGUgY29tcGxldGlvbiBib3VuZGFyeS4iCi0gIChsZXQgKChzdWZmaXggKGJ1ZmZlci1z
dWJzdHJpbmcgKHBvaW50KSBlbmQpKSkKLSAgICAoc3Vic3RyaW5nCi0gICAgIHN1ZmZpeAot
ICAgICAoY2RyIChjb21wbGV0aW9uLWJvdW5kYXJpZXMgKGJ1ZmZlci1zdWJzdHJpbmcgc3Rh
cnQgKHBvaW50KSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbGxlY3Rp
b24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRpY2F0ZQotICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4KSkpKSkKLQogKGRlZnVuIGNvbXBs
ZXRpb24tbWV0YWRhdGEgKHN0cmluZyB0YWJsZSBwcmVkKQogICAiUmV0dXJuIHRoZSBtZXRh
ZGF0YSBvZiBlbGVtZW50cyB0byBjb21wbGV0ZSBhdCB0aGUgZW5kIG9mIFNUUklORy4KIFRo
aXMgbWV0YWRhdGEgaXMgYW4gYWxpc3QuICBDdXJyZW50bHkgdW5kZXJzdG9vZCBrZXlzIGFy
ZToKQEAgLTEzNzcsNyArMTM2Myw3IEBAIGNvbXBsZXRpb24tLXJlcGxhY2UKICAgICAgIChz
ZXRxIG5ld3RleHQgKHN1YnN0cmluZyBuZXd0ZXh0IDAgKC0gc3VmZml4LWxlbikpKSkKICAg
ICAoZ290by1jaGFyIGJlZykKICAgICAobGV0ICgobGVuZ3RoICgtIGVuZCBiZWcpKSkgICAg
ICAgICA7UmVhZCBgZW5kJyBiZWZvcmUgd2UgaW5zZXJ0IHRoZSB0ZXh0LgotICAgICAgKGlu
c2VydC1hbmQtaW5oZXJpdCBuZXd0ZXh0KQorICAgICAgKGluc2VydC1iZWZvcmUtbWFya2Vy
cy1hbmQtaW5oZXJpdCBuZXd0ZXh0KQogICAgICAgKGRlbGV0ZS1yZWdpb24gKHBvaW50KSAo
KyAocG9pbnQpIGxlbmd0aCkpKQogICAgIChmb3J3YXJkLWNoYXIgc3VmZml4LWxlbikpKQog
CkBAIC0yNTk4LDEyICsyNTg0LDE1IEBAIG1pbmlidWZmZXItY29tcGxldGlvbi1oZWxwCiAg
ICAgICAgICAgICAgKGJhc2Utc2l6ZSAob3IgKGNkciBsYXN0KSAwKSkKICAgICAgICAgICAg
ICAocHJlZml4ICh1bmxlc3MgKHplcm9wIGJhc2Utc2l6ZSkgKHN1YnN0cmluZyBzdHJpbmcg
MCBiYXNlLXNpemUpKSkKICAgICAgICAgICAgICAobWluaWJ1ZmZlci1jb21wbGV0aW9uLWJh
c2UgKHN1YnN0cmluZyBzdHJpbmcgMCBiYXNlLXNpemUpKQotICAgICAgICAgICAgIChiYXNl
LXByZWZpeCAoYnVmZmVyLXN1YnN0cmluZyAobWluaWJ1ZmZlci0tY29tcGxldGlvbi1wcm9t
cHQtZW5kKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo
KyBzdGFydCBiYXNlLXNpemUpKSkKLSAgICAgICAgICAgICAoYmFzZS1zdWZmaXggKGNvbmNh
dCAoY29tcGxldGlvbi1iYXNlLXN1ZmZpeCBzdGFydCBlbmQKLSAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pYnVmZmVyLWNv
bXBsZXRpb24tdGFibGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBtaW5pYnVmZmVyLWNvbXBsZXRpb24tcHJlZGljYXRlKQot
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXItc3Vic3RyaW5nIGVu
ZCAocG9pbnQtbWF4KSkpKQorICAgICAgICAgICAgIChmaWVsZC1lbmQKKyAgICAgICAgICAg
ICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAgICAgICAgICAgKGZvcndhcmQtY2hhcgorICAg
ICAgICAgICAgICAgICAoY2RyIChjb21wbGV0aW9uLWJvdW5kYXJpZXMgKGJ1ZmZlci1zdWJz
dHJpbmcgc3RhcnQgKHBvaW50KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIG1pbmlidWZmZXItY29tcGxldGlvbi10YWJsZQorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluaWJ1ZmZlci1jb21wbGV0aW9u
LXByZWRpY2F0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKGJ1ZmZlci1zdWJzdHJpbmcgKHBvaW50KSBlbmQpKSkpCisgICAgICAgICAgICAgICAg
KHBvaW50LW1hcmtlcikpKQorICAgICAgICAgICAgIChmaWVsZC1jaGFyIChhbmQgKDwgZmll
bGQtZW5kIGVuZCkgKGNoYXItYWZ0ZXIgZmllbGQtZW5kKSkpCiAgICAgICAgICAgICAgKGFs
bC1tZCAoY29tcGxldGlvbi0tbWV0YWRhdGEgKGJ1ZmZlci1zdWJzdHJpbmctbm8tcHJvcGVy
dGllcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFy
dCAocG9pbnQpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IGJhc2Utc2l6ZSBtZApAQCAtMjY4NywzOCArMjY3NiwyNSBAQCBtaW5pYnVmZmVyLWNvbXBs
ZXRpb24taGVscAogCiAgICAgICAgICAgICAgICAgICAgICAgKHdpdGgtY3VycmVudC1idWZm
ZXIgc3RhbmRhcmQtb3V0cHV0CiAgICAgICAgICAgICAgICAgICAgICAgICAoc2V0cS1sb2Nh
bCBjb21wbGV0aW9uLWJhc2UtcG9zaXRpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKGxpc3QgKCsgc3RhcnQgYmFzZS1zaXplKQotICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICA7OyBGSVhNRTogV2Ugc2hvdWxkIHBheSBhdHRlbnRpb24gdG8gY29tcGxl
dGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBib3VuZGFyaWVz
IGhlcmUsIGJ1dCBjdXJyZW50bHkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgOzsgY29tcGxldGlvbi1hbGwtY29tcGxldGlvbnMgZG9lcyBub3QgZ2l2ZSB1cyB0aGUK
LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgbmVjZXNzYXJ5IGluZm9y
bWF0aW9uLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmQpKQotICAg
ICAgICAgICAgICAgICAgICAgICAgKHNldHEtbG9jYWwgY29tcGxldGlvbi1iYXNlLWFmZml4
ZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsaXN0IGJhc2UtcHJl
Zml4IGJhc2Utc3VmZml4KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxpc3Qg
KCsgc3RhcnQgYmFzZS1zaXplKSBmaWVsZC1lbmQpKQogICAgICAgICAgICAgICAgICAgICAg
ICAgKHNldHEtbG9jYWwgY29tcGxldGlvbi1saXN0LWluc2VydC1jaG9pY2UtZnVuY3Rpb24K
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxldCAoKGN0YWJsZSBtaW5pYnVmZmVy
LWNvbXBsZXRpb24tdGFibGUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChjcHJlZCBtaW5pYnVmZmVyLWNvbXBsZXRpb24tcHJlZGljYXRlKQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAoY3Byb3BzIGNvbXBsZXRpb24tZXh0cmEtcHJvcGVy
dGllcykpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAoc3RhcnQg
ZW5kIGNob2ljZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpZiAoYW5k
IChzdHJpbmdwIHN0YXJ0KSAoc3RyaW5ncCBlbmQpKQotICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIChwcm9nbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKGRlbGV0ZS1taW5pYnVmZmVyLWNvbnRlbnRzKQotICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgKGluc2VydCBzdGFydCBjaG9pY2UpCi0gICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBLZWVwIHBvaW50IGFmdGVyIGNv
bXBsZXRpb24gYmVmb3JlIHN1ZmZpeAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKHNhdmUtZXhjdXJzaW9uIChpbnNlcnQKLSAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbXBsZXRpb24tLW1lcmdl
LXN1ZmZpeAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgY2hvaWNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAoMS0gKGxlbmd0aCBjaG9pY2UpKQotICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kKSkp
KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodW5sZXNzIChvciAoemVy
b3AgKGxlbmd0aCBwcmVmaXgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAoZXF1YWwgcHJlZml4Ci0gICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYnVmZmVyLXN1YnN0cmluZy1uby1wcm9w
ZXJ0aWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKG1heCAocG9pbnQtbWluKQotICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKC0gc3RhcnQgKGxlbmd0aCBwcmVm
aXgpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBzdGFydCkpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChtZXNzYWdlICIqQ29tcGxldGlvbnMqIG91dCBvZiBkYXRlIikpCi0gICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIDs7IEZJWE1FOiBVc2UgYG1kJyB0byBkbyBxdW90aW5n
JnRlcm1pbmF0b3IgaGVyZS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
KGNvbXBsZXRpb24tLXJlcGxhY2Ugc3RhcnQgZW5kIGNob2ljZSkpCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAodW5sZXNzIChvciAoemVyb3AgKGxlbmd0aCBwcmVmaXgp
KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVxdWFs
IHByZWZpeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIChidWZmZXItc3Vic3RyaW5nLW5vLXByb3BlcnRpZXMKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1heCAocG9pbnQtbWlu
KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICgtIHN0YXJ0IChsZW5ndGggcHJlZml4KSkpCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0KSkpCisgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIChtZXNzYWdlICIqQ29tcGxldGlvbnMqIG91dCBv
ZiBkYXRlIikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAod2hlbiAoYW5k
IGZpZWxkLWNoYXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKD0gKGFyZWYgY2hvaWNlICgxLSAobGVuZ3RoIGNob2ljZSkpKQorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZC1jaGFyKSkKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNldHEgZW5kICgxKyBlbmQpKSkKKyAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IEZJWE1FOiBVc2UgYG1kJyB0byBk
byBxdW90aW5nJnRlcm1pbmF0b3IgaGVyZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIChjb21wbGV0aW9uLS1yZXBsYWNlIHN0YXJ0IGVuZCBjaG9pY2UpCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAobGV0KiAoKG1pbmlidWZmZXItY29tcGxldGlv
bi10YWJsZSBjdGFibGUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKG1pbmlidWZmZXItY29tcGxldGlvbi1wcmVkaWNhdGUgY3ByZWQpCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbXBsZXRpb24tZXh0cmEtcHJvcGVy
dGllcyBjcHJvcHMpCkBAIC00ODc3LDggKzQ4NTMsNyBAQCBtaW5pYnVmZmVyLW5leHQtY29t
cGxldGlvbgogICAgICAgICAgIChuZXh0LWxpbmUtY29tcGxldGlvbiAob3IgbiAxKSkKICAg
ICAgICAgKG5leHQtY29tcGxldGlvbiAob3IgbiAxKSkpCiAgICAgICAod2hlbiBhdXRvLWNo
b29zZQotICAgICAgICAobGV0ICgoY29tcGxldGlvbi11c2UtYmFzZS1hZmZpeGVzIHQpCi0g
ICAgICAgICAgICAgIChjb21wbGV0aW9uLWF1dG8tZGVzZWxlY3QgbmlsKSkKKyAgICAgICAg
KGxldCAoKGNvbXBsZXRpb24tYXV0by1kZXNlbGVjdCBuaWwpKQogICAgICAgICAgIChjaG9v
c2UtY29tcGxldGlvbiBuaWwgdCB0KSkpKSkpCiAKIChkZWZ1biBtaW5pYnVmZmVyLXByZXZp
b3VzLWNvbXBsZXRpb24gKCZvcHRpb25hbCBuKQpAQCAtNDkxNiw4ICs0ODkxLDcgQEAgbWlu
aWJ1ZmZlci1jaG9vc2UtY29tcGxldGlvbgogbWluaWJ1ZmZlciwgYnV0IGRvbid0IHF1aXQg
dGhlIGNvbXBsZXRpb25zIHdpbmRvdy4iCiAgIChpbnRlcmFjdGl2ZSAiUCIpCiAgICh3aXRo
LW1pbmlidWZmZXItY29tcGxldGlvbnMtd2luZG93Ci0gICAgKGxldCAoKGNvbXBsZXRpb24t
dXNlLWJhc2UtYWZmaXhlcyB0KSkKLSAgICAgIChjaG9vc2UtY29tcGxldGlvbiBuaWwgbm8t
ZXhpdCBuby1xdWl0KSkpKQorICAgIChjaG9vc2UtY29tcGxldGlvbiBuaWwgbm8tZXhpdCBu
by1xdWl0KSkpCiAKIChkZWZ1biBtaW5pYnVmZmVyLWNob29zZS1jb21wbGV0aW9uLW9yLWV4
aXQgKCZvcHRpb25hbCBuby1leGl0IG5vLXF1aXQpCiAgICJDaG9vc2UgdGhlIGNvbXBsZXRp
b24gZnJvbSB0aGUgbWluaWJ1ZmZlciBvciBleGl0IHRoZSBtaW5pYnVmZmVyLgpkaWZmIC0t
Z2l0IGEvbGlzcC9zaW1wbGUuZWwgYi9saXNwL3NpbXBsZS5lbAppbmRleCBlNDYyOWNlM2Ri
Ny4uNzQxY2Y1OWYzNDQgMTAwNjQ0Ci0tLSBhL2xpc3Avc2ltcGxlLmVsCisrKyBiL2xpc3Av
c2ltcGxlLmVsCkBAIC05ODU2LDE2ICs5ODU2LDYgQEAgY29tcGxldGlvbi1iYXNlLXBvc2l0
aW9uCiB3aGVyZSB0aGUgY29tcGxldGlvbiBzaG91bGQgYmUgaW5zZXJ0ZWQgYW5kIEVORCAo
aWYgbm9uLW5pbCkgaXMgdGhlIGVuZAogb2YgdGhlIHRleHQgdG8gcmVwbGFjZS4gIElmIEVO
RCBpcyBuaWwsIHBvaW50IGlzIHVzZWQgaW5zdGVhZC4iKQogCi0oZGVmdmFyIGNvbXBsZXRp
b24tYmFzZS1hZmZpeGVzIG5pbAotICAiQmFzZSBjb250ZXh0IG9mIHRoZSB0ZXh0IGNvcnJl
c3BvbmRpbmcgdG8gdGhlIHNob3duIGNvbXBsZXRpb25zLgotVGhpcyB2YXJpYWJsZSBpcyB1
c2VkIGluIHRoZSAqQ29tcGxldGlvbnMqIGJ1ZmZlci4KLUl0cyB2YWx1ZSBpcyBhIGxpc3Qg
b2YgdGhlIGZvcm0gKFBSRUZJWCBTVUZGSVgpIHdoZXJlIFBSRUZJWCBpcyB0aGUgdGV4dAot
YmVmb3JlIHRoZSBwbGFjZSB3aGVyZSBjb21wbGV0aW9uIHNob3VsZCBiZSBpbnNlcnRlZCwg
YW5kIFNVRkZJWCBpcyB0aGUgdGV4dAotYWZ0ZXIgdGhlIGNvbXBsZXRpb24uIikKLQotKGRl
ZnZhciBjb21wbGV0aW9uLXVzZS1iYXNlLWFmZml4ZXMgbmlsCi0gICJOb24tbmlsIG1lYW5z
IHRvIHJlc3RvcmUgb3JpZ2luYWwgcHJlZml4IGFuZCBzdWZmaXggaW4gdGhlIG1pbmlidWZm
ZXIuIikKLQogKGRlZnZhciBjb21wbGV0aW9uLWxpc3QtaW5zZXJ0LWNob2ljZS1mdW5jdGlv
biAjJ2NvbXBsZXRpb24tLXJlcGxhY2UKICAgIkZ1bmN0aW9uIHRvIHVzZSB0byBpbnNlcnQg
dGhlIHRleHQgY2hvc2VuIGluICpDb21wbGV0aW9ucyouCiBDYWxsZWQgd2l0aCB0aHJlZSBh
cmd1bWVudHMgKEJFRyBFTkQgVEVYVCksIGl0IHNob3VsZCByZXBsYWNlIHRoZSB0ZXh0CkBA
IC0xMDEyNiw3ICsxMDExNiw2IEBAIGNob29zZS1jb21wbGV0aW9uCiAgICh3aXRoLWN1cnJl
bnQtYnVmZmVyICh3aW5kb3ctYnVmZmVyIChwb3NuLXdpbmRvdyAoZXZlbnQtc3RhcnQgZXZl
bnQpKSkKICAgICAobGV0ICgoYnVmZmVyIGNvbXBsZXRpb24tcmVmZXJlbmNlLWJ1ZmZlcikK
ICAgICAgICAgICAoYmFzZS1wb3NpdGlvbiBjb21wbGV0aW9uLWJhc2UtcG9zaXRpb24pCi0g
ICAgICAgICAgKGJhc2UtYWZmaXhlcyBjb21wbGV0aW9uLWJhc2UtYWZmaXhlcykKICAgICAg
ICAgICAoaW5zZXJ0LWZ1bmN0aW9uIGNvbXBsZXRpb24tbGlzdC1pbnNlcnQtY2hvaWNlLWZ1
bmN0aW9uKQogICAgICAgICAgIChjb21wbGV0aW9uLW5vLWF1dG8tZXhpdCAoaWYgbm8tZXhp
dCB0IGNvbXBsZXRpb24tbm8tYXV0by1leGl0KSkKICAgICAgICAgICAoY2hvaWNlCkBAIC0x
MDE1OSwxMyArMTAxNDgsNyBAQCBjaG9vc2UtY29tcGxldGlvbgogICAgICAgKHdpdGgtY3Vy
cmVudC1idWZmZXIgYnVmZmVyCiAgICAgICAgIChjaG9vc2UtY29tcGxldGlvbi1zdHJpbmcK
ICAgICAgICAgIGNob2ljZSBidWZmZXIKLSAgICAgICAgIDs7IERvbid0IGFsbG93IGFmZml4
ZXMgdG8gcmVwbGFjZSB0aGUgd2hvbGUgYnVmZmVyIHdoZW4gbm90Ci0gICAgICAgICA7OyBp
biB0aGUgbWluaWJ1ZmZlci4gIFRodXMgY2hlY2sgZm9yIGBjb21wbGV0aW9uLWluLXJlZ2lv
bi1tb2RlJwotICAgICAgICAgOzsgdG8gaWdub3JlIG5vbi1uaWwgdmFsdWUgb2YgYGNvbXBs
ZXRpb24tdXNlLWJhc2UtYWZmaXhlcycgc2V0IGJ5Ci0gICAgICAgICA7OyBgbWluaWJ1ZmZl
ci1jaG9vc2UtY29tcGxldGlvbicuCi0gICAgICAgICAob3IgKGFuZCAobm90IGNvbXBsZXRp
b24taW4tcmVnaW9uLW1vZGUpCi0gICAgICAgICAgICAgICAgICBjb21wbGV0aW9uLXVzZS1i
YXNlLWFmZml4ZXMgYmFzZS1hZmZpeGVzKQotICAgICAgICAgICAgIGJhc2UtcG9zaXRpb24K
KyAgICAgICAgIChvciBiYXNlLXBvc2l0aW9uCiAgICAgICAgICAgICAgOzsgSWYgYWxsIGVs
c2UgZmFpbHMsIGp1c3QgZ3Vlc3MuCiAgICAgICAgICAgICAgKGxpc3QgKGNob29zZS1jb21w
bGV0aW9uLWd1ZXNzLWJhc2UtcG9zaXRpb24gY2hvaWNlKSkpCiAgICAgICAgICBpbnNlcnQt
ZnVuY3Rpb24pKSkpKQpAQCAtMTAzMjEsMTEgKzEwMzA0LDkgQEAgY29tcGxldGlvbi1zZXR1
cC1mdW5jdGlvbgogICAgICAgICAgICAgICAgIChidWZmZXItc3Vic3RyaW5nIChtaW5pYnVm
ZmVyLXByb21wdC1lbmQpIChwb2ludCkpKSkpKSkKICAgICAod2l0aC1jdXJyZW50LWJ1ZmZl
ciBzdGFuZGFyZC1vdXRwdXQKICAgICAgIChsZXQgKChiYXNlLXBvc2l0aW9uIGNvbXBsZXRp
b24tYmFzZS1wb3NpdGlvbikKLSAgICAgICAgICAgIChiYXNlLWFmZml4ZXMgY29tcGxldGlv
bi1iYXNlLWFmZml4ZXMpCiAgICAgICAgICAgICAoaW5zZXJ0LWZ1biBjb21wbGV0aW9uLWxp
c3QtaW5zZXJ0LWNob2ljZS1mdW5jdGlvbikpCiAgICAgICAgIChjb21wbGV0aW9uLWxpc3Qt
bW9kZSkKICAgICAgICAgKHNldHEtbG9jYWwgY29tcGxldGlvbi1iYXNlLXBvc2l0aW9uIGJh
c2UtcG9zaXRpb24pCi0gICAgICAgIChzZXRxLWxvY2FsIGNvbXBsZXRpb24tYmFzZS1hZmZp
eGVzIGJhc2UtYWZmaXhlcykKICAgICAgICAgKHNldHEtbG9jYWwgY29tcGxldGlvbi1saXN0
LWluc2VydC1jaG9pY2UtZnVuY3Rpb24gaW5zZXJ0LWZ1bikpCiAgICAgICAoc2V0cS1sb2Nh
bCBjb21wbGV0aW9uLXJlZmVyZW5jZS1idWZmZXIgbWFpbmJ1ZikKICAgICAgIChpZiBiYXNl
LWRpciAoc2V0cSBkZWZhdWx0LWRpcmVjdG9yeSBiYXNlLWRpcikpCg==

--------------08ARVNJ9AakF0UST5Z0Szv0r--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 11 Apr 2024 10:36:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 11 06:36:25 2024
Received: from localhost ([127.0.0.1]:55008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rurn7-00028a-Gh
	for submit <at> debbugs.gnu.org; Thu, 11 Apr 2024 06:36:25 -0400
Received: from wfout7-smtp.messagingengine.com ([64.147.123.150]:57199)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rurn2-00026p-2i
 for 48356 <at> debbugs.gnu.org; Thu, 11 Apr 2024 06:36:23 -0400
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailfout.west.internal (Postfix) with ESMTP id 8CF471C00168;
 Thu, 11 Apr 2024 06:36:04 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Thu, 11 Apr 2024 06:36:05 -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=1712831764;
 x=1712918164; bh=8Q57wahN1VnQaQ3+PtQt2vIY7yj5NqjQg/Fh0k5IvMs=; b=
 wrP6ImaPupJpC7I/3Hf17GlhF/ORwN82Ctw+XcTMfcDn3lHRW4L9VQnjHDBpE9KO
 HPuzi4dqAbksaQFBlzI8ijgzZLfCyximfQ+4ntBSU0ChGyD+4npm1fIVBLKmIs4c
 uma5zbGsDj8ZcfDl3t2rckh2ud/rQ2eQPrNu2pyJakE65NpsHfdWF6lcqQZWkGf5
 QS5o500yoEpRnfjycqz6suBqYBsCNuAHBkOnZXCo93lIbeEheCpHQz44N+U1OmT1
 ACBN87IsEEUn9+cvglEC2m7vT+a1VaBn6rNEOeseaYsudouWJogTZ4ZHY+UL30eT
 LuMORgKEMXzgm1EwqKQ95g==
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=fm2; t=1712831764; x=
 1712918164; bh=8Q57wahN1VnQaQ3+PtQt2vIY7yj5NqjQg/Fh0k5IvMs=; b=J
 FHGrslmCb74JprqOoKNi3cIj6WKSMTchY2jtZNhvyrm7m2XLXTwFM516kcF6TtVW
 IbnX7DjaCQ625LBW0enYYm28Muh2E8pc63sy/9oUQ5A1d8WOVlOHFbwK9Sdncc7U
 dnkCtjD3xBfRqUAGtYH8TP21RIy+X8MbNtG9ZexJ1exG2uTEzitpUZs1rW/wqQ7H
 IYZ34BpOCVFEgU/z64SIrV9sUpL8Io22ppDZekaQmIYpqgyI4pTas9EL33RVVzYF
 Ii4ZGt9UtFbYDsfkb/33MnGM1jDfVMWGKRwFNZRN02RvkiNRqgr3M/Z92mDiEfU8
 07oneH131CxDp2FUizWxw==
X-ME-Sender: <xms:E70XZmCMKPc9Vno8BQATEbvyE-M62g_w4SgpfZOCdUSyyl1De34lEQ>
 <xme:E70XZggh2JpTzisovOGtaOXSRd5y8_KJ5nZ7xSBXw-84ax28eGiskmrst8dNvDxco
 RTVpsmq_RS2wMxPBo4>
X-ME-Received: <xmr:E70XZpmYc3Zuk9DqSgUy1TyUzu_Qdjhdf3fExOVlRrUOOJaff1gDPi20NUcD5dYCAxXK>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehkedgfeduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu
 jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:E70XZkzbQOqQMRyNoysNzngs7lSE6PlOAO4hBC1LrOv-r_HhYHp7oA>
 <xmx:E70XZrRr91BMtUs6_Wzd9-N0udm07DUpgLLktyFD171eC3EBX4c-Gg>
 <xmx:E70XZvYv86aADisDJgXkUcBVPvEKnC4LwgR5rOe6kloyg9paY9FIoQ>
 <xmx:E70XZkQBCJBqVVspGLNHn3KrBaDB9R1GdNVrGAOTTfSnjJmyaizUug>
 <xmx:FL0XZqHJUVnZDDd5ZhGGyKjlZbEJ_zZBI-6U53Q-MMqERGG9442WyZkx>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 11 Apr 2024 06:36:01 -0400 (EDT)
Message-ID: <24a56954-3dc0-438e-a24a-3309e299be34@HIDDEN>
Date: Thu, 11 Apr 2024 13:36:00 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN> <865xwov165.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <865xwov165.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, juri@HIDDEN, monnier@HIDDEN,
 jdtsmith@HIDDEN, mail@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 11/04/2024 09:55, Eli Zaretskii wrote:
>> Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
>>   JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
>> Date: Thu, 11 Apr 2024 04:00:35 +0300
>> From: Dmitry Gutov <dmitry@HIDDEN>
>>
>> All right, please see the new function completion-base-suffix added in
>> 0288bc6c949. Any docstring improvements (and others) are welcome.
> 
> I tried to do that.
> 
> Is there any reason why this function shouldn't be called
> completion-boundary-suffix instead?

For such a name, I would probably expect the return value to be

   (buffer-substring (point) (cdr (completion-boundaries ...)))

Opinions welcome.

>> I guess we should also mention it in NEWS...
> 
> Yes, please.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 11 Apr 2024 06:55:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 11 02:55:50 2024
Received: from localhost ([127.0.0.1]:54786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ruoLb-0007uq-Lg
	for submit <at> debbugs.gnu.org; Thu, 11 Apr 2024 02:55:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43980)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ruoLW-0007sl-Gh
 for 48356 <at> debbugs.gnu.org; Thu, 11 Apr 2024 02:55:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ruoLG-0000xO-K1; Thu, 11 Apr 2024 02:55:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=PvOIeLbAMOfU0/6epqKo3GonVtlRRBDLfZoGAkWlSsY=; b=saQjN7joBf0q
 Y2fb10ZxnOQOHluF7AD+uv0itISI1Q7D+bmkfjcx8km1tK9AW9u+uF+E3SgY8PiGFxEXQQcR9cPm0
 hZTefvKnFKC3+DE5ic7XXrn0CcS2QWQDr7uDJZnTIde+3YYZVVng42Av1mferYegDl/RlXxLTM51U
 wOqZHrawdCbcR3WFQnxmwcNlGxLH1yqDagA+E7vmfoQ5JAZAoMHJXRyT8gXPIGn3T2BsJ7K8HsCw4
 54KxMWR1WT3KBK5T7WfweMSwV19ahSRrcwQ0B2AmsAtRmrRhteIPg26uOfe/I/ZQU9SZGTpMrnxSr
 hyW3yGA0DhX+3G2QxNqk3w==;
Date: Thu, 11 Apr 2024 09:55:14 +0300
Message-Id: <865xwov165.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN> (message from
 Dmitry Gutov on Thu, 11 Apr 2024 04:00:35 +0300)
Subject: Re: bug#48356: 28.0.50;
 choose-completion discards the suffix after the completion boundary
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
 <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, juri@HIDDEN, monnier@HIDDEN,
 jdtsmith@HIDDEN, mail@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
>  JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
> Date: Thu, 11 Apr 2024 04:00:35 +0300
> From: Dmitry Gutov <dmitry@HIDDEN>
> 
> All right, please see the new function completion-base-suffix added in 
> 0288bc6c949. Any docstring improvements (and others) are welcome.

I tried to do that.

Is there any reason why this function shouldn't be called
completion-boundary-suffix instead?

> I guess we should also mention it in NEWS...

Yes, please.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 11 Apr 2024 01:01:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 10 21:01:03 2024
Received: from localhost ([127.0.0.1]:54627 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ruioH-00085n-IM
	for submit <at> debbugs.gnu.org; Wed, 10 Apr 2024 21:01:02 -0400
Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:56257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1ruioB-00083b-1r
 for 48356 <at> debbugs.gnu.org; Wed, 10 Apr 2024 21:00:59 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfout.nyi.internal (Postfix) with ESMTP id 849701380170;
 Wed, 10 Apr 2024 21:00:40 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Wed, 10 Apr 2024 21:00:40 -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=1712797240;
 x=1712883640; bh=wMbE6pjliRsmUy84njODn1Yrn5oIOTCS3Kb7WiFY3Oo=; b=
 JLOw8UsIJ4wTpybCO4bb+6Mu23MrP6TNDbLuXDUaqsxXmJBq5CykdglfK/9z4X40
 wCAKXhKBPYjCcnX40bn6yeprkzByjsheLbt7sQrnoVQOmg3YZ4+2Ndg0Em7T/6uT
 XI+unYwD4GW+glVkETsniAXh6Unl4eJX74BcHwwvb3QcHUshbL2GalqEUXSZoLTz
 dZ4xnZDV+SisOnqjswjxpxIzp6lPBKtM5wA5YXFthVh+4aZAU1fX9obfwL0LiIpt
 VXoaULCdZjdjaN8N6MLtCD6oTc9wq8V996ewOvS7ZpO1hY9A5AGrzgIpdi+Bj9tF
 4QTbTXo1iImBV4rL06u/NA==
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=fm2; t=1712797240; x=
 1712883640; bh=wMbE6pjliRsmUy84njODn1Yrn5oIOTCS3Kb7WiFY3Oo=; b=S
 B6qViLfPCtCCTlShgOC/7ck5WZotbq3HJfeMwMvx/b0IT2Hi4RP2MVNtmNmLwBW9
 OEQ1SFz+kyJDOCuG5Na3I8T9GGMG7aLqLeAxzGAXgVkj+eSBXYQqkfSf7OBQn2Yb
 iTivZzY60oYA1YDyF8toD0/YRheNegJu0KaZv5qI26KYutLNi1X0B0lt4Dlv+clg
 rp/HPM8tGOg9xF3mS/z+D6SUdtxbB0WJ/5zAGI9vkP9h4OSEYcwxOZTgGSaH6A9x
 YwF13SakjowVqfcw9cckW6J9DSF7IOrfH50AZYJ0E41fOGStJSoKLtfFUCD+z4V8
 IUycwll/Cf7cxhqbFr4XA==
X-ME-Sender: <xms:NzYXZsans0YqKdLwP64-47ufTOwlCCkrqOGpQT-DPhd2R6DqNilHNA>
 <xme:NzYXZnZvuCnprZJoaoAl07l5KVzYTlLg7qAqw2BHQy_qJC9FIn9aKlK33F4YQWmF7
 z1LqT7j96xYPpo9yxg>
X-ME-Received: <xmr:NzYXZm_R04NNAC_8hlSGzUjPMOGyI-soCC3EvDBCMzW8ATFEUjgHKnA3Wp6Ho4Y-Zhjb>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehjedggedvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeu
 keeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:ODYXZmpSkQjJEqTRAYu6hvCVrtclnJGgm6_y2PDD9FcVH1xdjPti9g>
 <xmx:ODYXZnoX51enoPLrvQ-u4iICP9ew3_emAZwXBk7m1I2olndMwYe5aQ>
 <xmx:ODYXZkQ32_3v8iQilTAkAgwSGV-fvFjEwGPBbQr06b70vUPOQIzbIw>
 <xmx:ODYXZnoxS2e1ouvBHCdEV_BbhQXlfqOxU_fZMSmrZRWUetpS364d3g>
 <xmx:ODYXZoBXjudGSX5PqBbkV3VC-v84UpASYfkx5OthuVgDA7l8pYD9njpx>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 10 Apr 2024 21:00:38 -0400 (EDT)
Message-ID: <5f353cfe-b2d7-43ab-bc65-37a0d306c042@HIDDEN>
Date: Thu, 11 Apr 2024 04:00:35 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
 <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 10/04/2024 05:38, Stefan Monnier wrote:
>>>> ...which translates to "/" because of the double slash -- the filesystem
>>>>    root directory (*). But that's the same data which would be used by any
>>>>    other proposed solution, too.
>>> More or less, tho the "ideal" solution is to do that in the
>>> completion-style code, which has a bit more knowledge about it.
>> Doing it in completion-style, though, would either require a relatively
>> awkward change in most/all styles (e.g. the "new dynamic variable" route),
>> or a more straightforward change in styles together with an incompatible
>> change in completion-all-completions.
> 
> Yup, hence the quotes around "ideal".
> 
>> So on balance, would you say it's a good idea to a) use this approach in
>> minibuffer-completion-help, b) create a named function for it, for other
>> callers to take advantage of it as well?
> 
> Yes, while waiting for a new API it seems like a good stop gap.
> 
>> Looks like completion--merge-suffix is the helper to use.
> 
> Yup.
> 
>>> In theory this approach can "do the wrong thing" with some completion
>>> styles, but AFAIK they haven't been written yet.  🙂
>> So you figure that such theoretical style would return adjusted base-suffix
>> in -all-completions method, not just in -try-completion?
> 
> A completion style could make use of (and list) things after the
> boundary.  E.g. completing a file name like
> 
>      foo/ba<|>ar/baz
> 
> could decide to list all the files that match
> 
>      *f*o*o*/*b*a*a*r*/*b*a*z*
> 
> in which case the "end boundary" of the `completion-all-completions`
> output should not be the `cdr` of the `completion-boundaries`.
> 
> I wouldn't worry about it, tho.

All right, please see the new function completion-base-suffix added in 
0288bc6c949. Any docstring improvements (and others) are welcome.

I guess we should also mention it in NEWS...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 10 Apr 2024 02:39:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 22:39:20 2024
Received: from localhost ([127.0.0.1]:51844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ruNrs-0000HV-J7
	for submit <at> debbugs.gnu.org; Tue, 09 Apr 2024 22:39:20 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59070)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1ruNrq-0000HG-8r
 for 48356 <at> debbugs.gnu.org; Tue, 09 Apr 2024 22:39:19 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4F382442B68;
 Tue,  9 Apr 2024 22:39:02 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1712716740;
 bh=q73tWnNHm8IDR5UhIqGdkB2z8FyBk3drguu62kjqOFs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=dCdHfAeOZOR+20klBoQV7M1D9YmFqLFQ7yQZgK8B2Fl8Tn8kcIjZPFPICuwMIHMYh
 mrQbE+7m0fvQVSDS0x5m+Dgjc8rlQg7WAXzsZa3q3NoWtdBqKy76DAo1EdUIzjwx/2
 vMj0jbtnzLE2sR8yetuJ8xNERW/ZG+HFDMrK+IZp+AQg+OE9uvZmxsFNusKOaZRQpN
 aLq4H3dW/HiAlq8CsMmciRqYfdtrYZLQgIg5wFXyKE+jfknGVmgo9S05WVDvPX4zk2
 9xwh0HEEvj60VdyjTO5v/E/7RuCf1TUuzmsLIoNY3FtNQuOJMy8Go2G9r35lkC1YGL
 2ohbT1wZHBx/g==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 722A4442B5A;
 Tue,  9 Apr 2024 22:39:00 -0400 (EDT)
Received: from pastel (unknown [45.72.201.215])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3E6E2120588;
 Tue,  9 Apr 2024 22:39:00 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
In-Reply-To: <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN> (Dmitry Gutov's
 message of "Wed, 10 Apr 2024 04:33:44 +0300")
Message-ID: <jwvsezu54r4.fsf-monnier+emacs@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
 <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
Date: Tue, 09 Apr 2024 22:38:59 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.022 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>>> ...which translates to "/" because of the double slash -- the filesystem
>>>   root directory (*). But that's the same data which would be used by a=
ny
>>>   other proposed solution, too.
>> More or less, tho the "ideal" solution is to do that in the
>> completion-style code, which has a bit more knowledge about it.
> Doing it in completion-style, though, would either require a relatively
> awkward change in most/all styles (e.g. the "new dynamic variable" route),
> or a more straightforward change in styles together with an incompatible
> change in completion-all-completions.

Yup, hence the quotes around "ideal".

> So on balance, would you say it's a good idea to a) use this approach in
> minibuffer-completion-help, b) create a named function for it, for other
> callers to take advantage of it as well?

Yes, while waiting for a new API it seems like a good stop gap.

> Looks like completion--merge-suffix is the helper to use.

Yup.

>> In theory this approach can "do the wrong thing" with some completion
>> styles, but AFAIK they haven't been written yet.  =F0=9F=99=82
> So you figure that such theoretical style would return adjusted base-suff=
ix
> in -all-completions method, not just in -try-completion?

A completion style could make use of (and list) things after the
boundary.  E.g. completing a file name like

    foo/ba<|>ar/baz

could decide to list all the files that match

    *f*o*o*/*b*a*a*r*/*b*a*z*

in which case the "end boundary" of the `completion-all-completions`
output should not be the `cdr` of the `completion-boundaries`.

I wouldn't worry about it, tho.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 10 Apr 2024 01:34:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 09 21:34:06 2024
Received: from localhost ([127.0.0.1]:51824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ruMqj-0004ia-Gz
	for submit <at> debbugs.gnu.org; Tue, 09 Apr 2024 21:34:05 -0400
Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]:44781)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1ruMqg-0004hu-Ef
 for 48356 <at> debbugs.gnu.org; Tue, 09 Apr 2024 21:34:03 -0400
Received: from compute7.internal (compute7.nyi.internal [10.202.2.48])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id 6D4F111401D5;
 Tue,  9 Apr 2024 21:33:48 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Tue, 09 Apr 2024 21:33:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc: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=1712712828; x=1712799228; bh=P3HshxZquV
 oHqL/bcRI81VpBP9sp7axSP+4G30b1hQ8=; b=nWVBOm1dpuCZKg026jXHBedZHv
 n+WGYndDHTRRG5n17wUK4vIf12B8lieIuRAVuYaIbOrv/K7OvMX6BeYyKdl0Dbzr
 QSiIUpmCOjFzgsSOQubAdBPVX9mxGgVfnd4ZWJh0zS2RnbttTr9DFLS38Tea60KS
 wpbgs+56wSXlaTa7dSbhmWpFOPsRyyc2/QUXRRR5slvaErd5lK05tbOF6onLVpPG
 wOwreo16z1cixX8HL8vYbLtz7joQs/TlU58Lcp0OGMemvf4NrWqNuVreXrCVbooI
 Qj+i/rFbzl4p91oljpkW3etF2WBgT17iksUavyqxbgW1QHhWfUjpCa76l/lg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc: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=
 fm2; t=1712712828; x=1712799228; bh=P3HshxZquVoHqL/bcRI81VpBP9sp
 7axSP+4G30b1hQ8=; b=xfDw+qhDJZ+7GquLUREAdyYBqzr+qLEdqxVWOWPKkCBQ
 uQXnnLHfh4ik+qxiG0JtEPpOsLD5agJkXuUIk2M4kgGXyNneT3ZJ/GrioOCRjwy5
 XPGCP4RHAO/tzaoMLhIkOsP+uIchFaJ5thRiy3Ul/PbkFQgDkPVFtgfQQK767KRG
 hCxwd0GW/1xU0Rj0nkzlHmBRHMcegjjhtQYYHPEpaJDfrUTeJwn7uVbIzg+Mu45Q
 OzJxJF1TVKf+D6aV2TtrqCtzHbostOEWrmUv7/PZSbKfC4dLnTVHrov5YnSHW1M0
 TTZeGo8RYlrq7vVbjSg3UtEPHXT6rwA502I7YWfaww==
X-ME-Sender: <xms:e-wVZuHIR5pQydeTm9y84IB6QLnSMUiwql1IR55XWdTgTfjuQEMmYg>
 <xme:e-wVZvXJbMQ01BOEAd4VzgK1Z1kBSDD6l0zYEwwSAhKvomg3795ZhiwX3K6_P1_X4
 fDvcr1_htcPppoOYWk>
X-ME-Received: <xmr:e-wVZoJzAPuhO3UmCI_mmBjVLqjOX_OUVuLgYTh6mPymXNSW_zn6pP9ckdv9UUsMQzUb>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehhedggeeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeenucfhrhhomhepffhmihht
 rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth
 gvrhhnpeehleefudekudduveekieelgfeiffdvkefhkeeljeeujeegueekveffkeejjeev
 heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh
 hithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:e-wVZoFms8PI9l95W7RRrOQvs9U__y4Rq_-sQfAfwvu3ZYghd-i0Sg>
 <xmx:e-wVZkVPqhrrwXxSO8S3K22PzAvGrUS10HtDHx_yLtFc7iIqRZScRg>
 <xmx:e-wVZrNaPsicl8HUiMPDYgsPMfFZ7iuTC6m0cSSODHoXmmyWDn6I9A>
 <xmx:e-wVZr0Bq5GoV21-ZR22bYj-CcedZdo9IErykGq9VkqWfKbKkcaiRA>
 <xmx:fOwVZuffbtZpy3Br4XgU_mfA9_Y03BChSwloMhliTx2JS1uxx0WuoB9U>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 9 Apr 2024 21:33:46 -0400 (EDT)
Content-Type: multipart/mixed; boundary="------------rRBx3yTGZuw0SsBqV5VUfMxZ"
Message-ID: <82196eff-85e6-44da-89e4-4ead4d72e657@HIDDEN>
Date: Wed, 10 Apr 2024 04:33:44 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
 <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------rRBx3yTGZuw0SsBqV5VUfMxZ
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Stefan,

On 09/04/2024 02:50, Stefan Monnier wrote:
>> ...which translates to "/" because of the double slash -- the filesystem
>>   root directory (*). But that's the same data which would be used by any
>>   other proposed solution, too.
> 
> More or less, tho the "ideal" solution is to do that in the
> completion-style code, which has a bit more knowledge about it.

Doing it in completion-style, though, would either require a relatively 
awkward change in most/all styles (e.g. the "new dynamic variable" 
route), or a more straightforward change in styles together with an 
incompatible change in completion-all-completions.

So on balance, would you say it's a good idea to a) use this approach in 
minibuffer-completion-help, b) create a named function for it, for other 
callers to take advantage of it as well?

IIUC Vertico (and other minibuffer completion UIs) might be interested.

>>   So maybe it should be either be fixed in the
>>   completion table (avoid adding trailing slash when the last boundary is
>>   already followed by slash?), or the insertion code should do some
>>   additional post-processing of the completion string.
> 
> I think you can fix it in the same ad-hoc way we use elsewhere: compare
> the first char after the boundary with the last char of the completion
> and drop one of the two if they're the same.

Looks like completion--merge-suffix is the helper to use.

>> +             (base-suffix (let ((suffix (buffer-substring (point) end)))
>> +                            (substring
>> +                             suffix
>> +                             (cdr (completion-boundaries string
>> +                                                         minibuffer-completion-table
>> +                                                         minibuffer-completion-predicate
>> +                                                         suffix)))))
> 
> I think you want to be careful to pass (buffer-substring start (point))
> rather than `string` to `completion-boundaries`.

Thanks, see the update attached.

> In theory this approach can "do the wrong thing" with some completion
> styles, but AFAIK they haven't been written yet.  🙂

So you figure that such theoretical style would return adjusted 
base-suffix in -all-completions method, not just in -try-completion?
--------------rRBx3yTGZuw0SsBqV5VUfMxZ
Content-Type: text/x-patch; charset=UTF-8; name="base-suffix-v2.diff"
Content-Disposition: attachment; filename="base-suffix-v2.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2xpc3AvbWluaWJ1ZmZlci5lbCBiL2xpc3AvbWluaWJ1ZmZlci5lbApp
bmRleCA0MWIyMDE3NGJlMS4uMGNjY2M0NjQ0OGIgMTAwNjQ0Ci0tLSBhL2xpc3AvbWluaWJ1
ZmZlci5lbAorKysgYi9saXNwL21pbmlidWZmZXIuZWwKQEAgLTI1ODYsMTYgKzI1ODYsMTMg
QEAgbWluaWJ1ZmZlci1jb21wbGV0aW9uLWhlbHAKICAgICAgICAgICAgICAobWluaWJ1ZmZl
ci1jb21wbGV0aW9uLWJhc2UgKHN1YnN0cmluZyBzdHJpbmcgMCBiYXNlLXNpemUpKQogICAg
ICAgICAgICAgIChiYXNlLXByZWZpeCAoYnVmZmVyLXN1YnN0cmluZyAobWluaWJ1ZmZlci0t
Y29tcGxldGlvbi1wcm9tcHQtZW5kKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAoKyBzdGFydCBiYXNlLXNpemUpKSkKLSAgICAgICAgICAgICAoYmFz
ZS1zdWZmaXgKLSAgICAgICAgICAgICAgKGlmIChvciAoZXEgKGFsaXN0LWdldCAnY2F0ZWdv
cnkgKGNkciBtZCkpICdmaWxlKQotICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRpb24t
aW4tcmVnaW9uLW1vZGUtcHJlZGljYXRlKQotICAgICAgICAgICAgICAgICAgKGJ1ZmZlci1z
dWJzdHJpbmcKLSAgICAgICAgICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KLSAgICAgICAg
ICAgICAgICAgICAgIChpZiBjb21wbGV0aW9uLWluLXJlZ2lvbi1tb2RlLXByZWRpY2F0ZQot
ICAgICAgICAgICAgICAgICAgICAgICAgIChwb2ludCkKLSAgICAgICAgICAgICAgICAgICAg
ICAgKG9yIChzZWFyY2gtZm9yd2FyZCAiLyIgbmlsIHQpIChwb2ludC1tYXgpKSkpCi0gICAg
ICAgICAgICAgICAgICAgKHBvaW50LW1heCkpCi0gICAgICAgICAgICAgICAgIiIpKQorICAg
ICAgICAgICAgIChiYXNlLXN1ZmZpeCAobGV0ICgoc3VmZml4IChidWZmZXItc3Vic3RyaW5n
IChwb2ludCkgZW5kKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN1YnN0cmlu
ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWZmaXgKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgKGNkciAoY29tcGxldGlvbi1ib3VuZGFyaWVzIChidWZmZXItc3Vi
c3RyaW5nIHN0YXJ0IChwb2ludCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pYnVmZmVyLWNvbXBsZXRpb24tdGFibGUK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIG1pbmlidWZmZXItY29tcGxldGlvbi1wcmVkaWNhdGUKKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeCkpKSkpCiAg
ICAgICAgICAgICAgKGFsbC1tZCAoY29tcGxldGlvbi0tbWV0YWRhdGEgKGJ1ZmZlci1zdWJz
dHJpbmctbm8tcHJvcGVydGllcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBzdGFydCAocG9pbnQpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGJhc2Utc2l6ZSBtZApAQCAtMjY5Nyw3ICsyNjk0LDExIEBAIG1p
bmlidWZmZXItY29tcGxldGlvbi1oZWxwCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAoZGVsZXRlLW1pbmlidWZmZXItY29udGVudHMpCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAoaW5zZXJ0IHN0YXJ0IGNob2ljZSkKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IEtlZXAgcG9pbnQgYWZ0ZXIg
Y29tcGxldGlvbiBiZWZvcmUgc3VmZml4Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24gKGluc2VydCBlbmQpKSkKKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzYXZlLWV4Y3Vyc2lvbiAoaW5zZXJ0Cisg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IChjb21wbGV0aW9uLS1tZXJnZS1zdWZmaXgKKyAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNob2ljZQorICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEtIChsZW5ndGgg
Y2hvaWNlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGVuZCkpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgKHVubGVzcyAob3IgKHplcm9wIChsZW5ndGggcHJlZml4KSkKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVxdWFsIHByZWZpeAogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJ1ZmZl
ci1zdWJzdHJpbmctbm8tcHJvcGVydGllcwo=

--------------rRBx3yTGZuw0SsBqV5VUfMxZ--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 8 Apr 2024 23:50:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 08 19:50:36 2024
Received: from localhost ([127.0.0.1]:47882 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rtyl1-00033L-Jd
	for submit <at> debbugs.gnu.org; Mon, 08 Apr 2024 19:50:36 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22354)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1rtykv-00031W-5c
 for 48356 <at> debbugs.gnu.org; Mon, 08 Apr 2024 19:50:33 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F0E64100198;
 Mon,  8 Apr 2024 19:50:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1712620209;
 bh=z9KuwOR70nXs/6tuxa54MrRILG54CNnZ/xYX2W7A2R8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=gitQHmXb0/KPONT0GQ3B4WtHnwzHJTmDStDX8iZTimFen5eRy5BCJ/DuECF9pss58
 UxzuJQTGRll299/gzF0BkmAsk/XdVsXdNwaJ5cAz0l/Ziwqz6Pp3vYq0WDzpmR9g1R
 h17QtPNlw8KZMuzCAj3snETir5mpXQG3mz9r9y6KVJVaa6WTsoJ4JYR2LerGMS02Jb
 LZ7wse3E1fficvUFSC5mZN5F7EBmTSUZrtTvFxE4JtaaOH5g6GWZmJe4KDIwAwU25W
 Tb16AjFxxeN/A9gxhPB368oSM5XwT0lz712C/gAyidw9wCANPg3ynH7PKvxmoHXHxH
 YKN5UNsHl7e2A==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 71D6D10005D;
 Mon,  8 Apr 2024 19:50:09 -0400 (EDT)
Received: from pastel (unknown [45.72.201.215])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3F00F12080A;
 Mon,  8 Apr 2024 19:50:09 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
In-Reply-To: <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN> (Dmitry Gutov's
 message of "Tue, 9 Apr 2024 00:59:32 +0300")
Message-ID: <jwvedbfbevp.fsf-monnier+emacs@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
Date: Mon, 08 Apr 2024 19:50:07 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.017 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Daniel Mendler <mail@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> ...which translates to "/" because of the double slash -- the filesystem
>  root directory (*). But that's the same data which would be used by any
>  other proposed solution, too.

More or less, tho the "ideal" solution is to do that in the
completion-style code, which has a bit more knowledge about it.

>  So maybe it should be either be fixed in the
>  completion table (avoid adding trailing slash when the last boundary is
>  already followed by slash?), or the insertion code should do some
>  additional post-processing of the completion string.

I think you can fix it in the same ad-hoc way we use elsewhere: compare
the first char after the boundary with the last char of the completion
and drop one of the two if they're the same.

> +             (base-suffix (let ((suffix (buffer-substring (point) end)))
> +                            (substring
> +                             suffix
> +                             (cdr (completion-boundaries string
> +                                                         minibuffer-comp=
letion-table
> +                                                         minibuffer-comp=
letion-predicate
> +                                                         suffix)))))

I think you want to be careful to pass (buffer-substring start (point))
rather than `string` to `completion-boundaries`.

In theory this approach can "do the wrong thing" with some completion
styles, but AFAIK they haven't been written yet.  =F0=9F=99=82


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 8 Apr 2024 22:28:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 08 18:28:01 2024
Received: from localhost ([127.0.0.1]:47835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rtxT6-0003pj-Ng
	for submit <at> debbugs.gnu.org; Mon, 08 Apr 2024 18:28:01 -0400
Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]:42371)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rtxT4-0003p8-K1
 for 48356 <at> debbugs.gnu.org; Mon, 08 Apr 2024 18:27:59 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id 9FF521140179;
 Mon,  8 Apr 2024 18:27:45 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Mon, 08 Apr 2024 18:27:45 -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=1712615265;
 x=1712701665; bh=3lJmv1nu2dJr6YMNlgAwQ05lpNt76bmgfCd+A0zqyyo=; b=
 EQuSNDpTU9ZsT8hqGmijs14zNU9EAg4dhUs2enV22K0/zfz4RLA6Cka20CdalrUG
 PRfcb4xZPaCrhybKlPUJ4urr29zHfoyp8X/brVSFKEkEyaKo40BcTnphZe2m4haA
 4ICSw5xKi6mXW6EOHF8sJJmsyA++jfFR7pMkfNidMOyqctRkptqDBXEN539+yaxi
 yakMpTuCUNd+DiLmtkiEYhMZ1tCltosK38lF8lyDYhSVmXwQtm7NIsJbcBv9HQek
 BDSIy3On9+g2l1KuODBJUMDdwDqzB5gd1FTFJ0252++gXC59R8sZeW0B9RV4Ogn+
 4kGB1Rwlea8ZebbulffDbg==
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=fm2; t=1712615265; x=
 1712701665; bh=3lJmv1nu2dJr6YMNlgAwQ05lpNt76bmgfCd+A0zqyyo=; b=W
 e3rowHrvvz5YCmixXyDfHoz2VMFeOEjOoZI5QNyi3cibSB4W/5ulv99YxQr+Nn3t
 oLytTpa3zeCBRQHYihvDKj0QBbU47/GVNiFOy8GZ7EHEWurIKuVSiqtagWxNv1vz
 I9xWvYQlsvXCUAFXvVuwnXNA/Mbur8KsU1WpviXe/z7CuTX544OfhIX87zq0qBEj
 3q/d3yYWckKsE3gCVi0+tyLVy1028b5YkvtRTFuhSMOKFqKT6NDmVzNAHqVVOCJm
 24cwG04dTFo4nSDVLjRHbWDiI6uIm1K5wCbcbYRv2Fz9adMqTHiT8UBCQiEiD3nl
 DSLZIIfdBBnx76uP0xvRg==
X-ME-Sender: <xms:YW8UZsqagqJvSCHTiiY0DeS6qOlkHpr9iw0naGOKKVKQjwJMcZ9duw>
 <xme:YW8UZiqA265EXWTn6jXWsSM49k9rLEY9JskNKxSMlPxokVM6DUsM4RJNEOjDccssH
 l6T4Afaryx3crn4cGA>
X-ME-Received: <xmr:YW8UZhOmszKvdcUvcr_eE7423gPDfg4YwlZn1dUkc94FKNTbYDTnxnnLlBqvyVf4TRPh>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegjedguddtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhepkeefudefgfejffefvdfhteegveevhfekkeekhffgudfhveejteffhfegueet
 gefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:YW8UZj40Gta4xdXcA9lOtkG_bj7_bSa7fC6-c76lYNzO-rtaZcLHeg>
 <xmx:YW8UZr62g92G3JzNAaFq8BohbySZp97Ysd0AdtDwPad9H25oDy6Z9w>
 <xmx:YW8UZjgfUmPAUeT--oD0v0gMgNid7FDlAcl_8cVkLzjNymbeMNsVfw>
 <xmx:YW8UZl4sQdwg9oLABkI3aJjiDkT2FPg-E2fcvW_rNgzCOc6Y7LKSKA>
 <xmx:YW8UZhTRnTzN6PHSQlPLWPLb1Psx9NYthwX6Jo64ssUCCjMKR6fR3dS_>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 8 Apr 2024 18:27:43 -0400 (EDT)
Message-ID: <06c71965-497f-42e3-b3d0-7c0b5f1820cd@HIDDEN>
Date: Tue, 9 Apr 2024 01:27:42 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Daniel Mendler <mail@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
 <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
In-Reply-To: <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 09/04/2024 00:59, Dmitry Gutov wrote:
> But what I don't quite see yet, is why wouldn't the caller be able to 
> compute the bounds cheaply enough? We could offer an accessor function.

Reading completion-pcm--find-all-completions, it seems like the case 
where this wouldn't work is "The prefix has no completions at all ...".

What scenarios does this correspond to? If they are limited to the cases 
where the point jumps to a different field (and then completion has to 
be repeated), then maybe my patch would still be fine.

Otherwise, perhaps one of the other approaches is the way to go.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 8 Apr 2024 21:59:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 08 17:59:54 2024
Received: from localhost ([127.0.0.1]:47810 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rtx1u-0001DK-D1
	for submit <at> debbugs.gnu.org; Mon, 08 Apr 2024 17:59:54 -0400
Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:39321)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1rtx1q-0001Ci-CG
 for 48356 <at> debbugs.gnu.org; Mon, 08 Apr 2024 17:59:52 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailfout.nyi.internal (Postfix) with ESMTP id 5774D1380143;
 Mon,  8 Apr 2024 17:59:36 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Mon, 08 Apr 2024 17:59:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc: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=1712613576; x=1712699976; bh=bdczJkp9bJ
 Dqu5gH9ViWR6lXUTr5yQt9OnkvS+jAkQ4=; b=vFFOUHmFrAkfPU6ejc5xp/+Mk3
 cW4OfSaKpNTH6TVXhjtQvkXn3Bk86kKTwOTXXhEY62kKlSmfwsrQ3yEswXcPby4N
 We9aij9W2guSpSbaZ7o6lDD5Zyv456/ncNG6gUmZrHwQCQqi8S8/bSyj13NCn0J5
 SRra73smyL51daWympOUFb6TaQRY26C1WWv+5PLjnUexF05yjlDS9TqZcltTB0qy
 gJO6LkQ7194MLu1lXnsb2tVTt27X31VR0vdcpIFL5wDlpDkljph6Sykv6KZTKt7C
 PcOWFDPPTJUIxN6voF1gCMfE04/Z3kh2aP4sl5wgLwJjvpXQXDU6mgLAdbNg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc: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=
 fm2; t=1712613576; x=1712699976; bh=bdczJkp9bJDqu5gH9ViWR6lXUTr5
 yQt9OnkvS+jAkQ4=; b=hDzxLL9Mr4+pg9ci7nZYN+6R2ZztogSgHKkIHlVfaEaP
 X2rIX+hwPB8ZNmogNgn1WkiC5rp/WLMYB/riAETpOC3boRDb19ejjKH44ayP4wGA
 UT0QHPkFkxEdapgJSzI7RXoysfT9C6iRaKskeuDcz+GRLp/qlbfVdX9ri1tiGkYU
 QthIwJM6U2ndnsKHmvqLyGU04GGoatq0V8lgrMcid6zEgGO7ZHz1oj/pg9sv+FZL
 INhay17+jkvkQujf1F3XvxoJGqWNFfhFHNTcBQOEGhukHMrkTIwyNsDBbiYuHOQ4
 tHuqf5ORcGb3TBAWN1lqMtNO7FaHq5tOshiarm8+BA==
X-ME-Sender: <xms:x2gUZqmIFBwugZ3sAfZH2_hK_Ree_cru7k5k2ZuQ1r8XUPOtOcp4Cg>
 <xme:x2gUZh0iSDmMjerqdjDQKdsm9um6lkxVbwZUpl7qCbesYypmCyOloNDpiZG2dZE4c
 v6PTWqbzj0w-QrB5hE>
X-ME-Received: <xmr:x2gUZorseMJqTkMd2zhRqNCX52xOyMYESjPq_nre0gWuqF_u_aIkEhN9wC1RlXjc0cMg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegjedgtdegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeenucfhrhhomhepffhmihht
 rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth
 gvrhhnpeelkeejiedvffdtgeejvdffffelueelkefhtdekjeehuefgteduheegfefhieek
 jeenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf
 grrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:x2gUZukeHHJ96IoGaQGwtJ9lcC1oQFXh42WnrUXYW4mQ_0Pp4yoj2Q>
 <xmx:x2gUZo1DzqIvN-l5I9dXL7tngV1gkPH_jIybvxDz9_c4VSr2icivjA>
 <xmx:x2gUZlsNZq_pRrLTaBs9V7Vun7ZILqGw2RbBOuGCLTKPSZqZxSE_-A>
 <xmx:x2gUZkUD9QpFEWzOa2kBL0mYLy29_ON6OznS4bFTjt4xz9sYJ4o-Jg>
 <xmx:yGgUZs-rDmU6BKMZ1MUyuWWl1fhhD0v6MUv4x-SgKx4Ehxk4YGhS8aIt>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 8 Apr 2024 17:59:34 -0400 (EDT)
Content-Type: multipart/mixed; boundary="------------bJEsTBOpw0RiDhC4vRhM2oUC"
Message-ID: <39326c56-094c-4074-95d7-8f92f7f927a5@HIDDEN>
Date: Tue, 9 Apr 2024 00:59:32 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Juri Linkov <juri@HIDDEN>, Daniel Mendler <mail@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN> <868rt42wiz.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <868rt42wiz.fsf@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.
--------------bJEsTBOpw0RiDhC4vRhM2oUC
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 20/03/2022 22:34, Juri Linkov wrote:
>>>>> IMHO, the root of the problem is in completion-all-completions
>>>>> that returns in the last `cdr' only the start of completions,
>>>>> but not the end of completions.
>>>> Agreed.
>>> If I recall correctly, someone wrote a patch which fixed the root cause.
>> The only patch that removes these comments
>>
>>          ;; FIXME: We need to additionally return the info needed for the
>>          ;; second part of completion-base-position.
>>
>>          ;; FIXME: We should pay attention to completion
>>          ;; boundaries here, but currently
>>          ;; completion-all-completions does not give us the
>>          ;; necessary information.
>>
>> ishttps://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00412.html
>> in bug#47711 and bug#48841.
> I wonder what is the fate of this patch?  There was a long discussion
> without a clear outcome.  Maybe it's possible to split the patch
> to smaller parts where a separate patch would add the feature needed here
> to return the end position of the completion boundaries?

It seems there is a range of solutions we could take here.

On the one side would be a replacement of the -all-completions API with 
something like completion-filter-completions as proposed by Daniel. It's 
still a reasonable choice, but a rather breaking one, and the patch 
would need to be majorly rewritten anyway, given the amount of changes 
in the area since it was submitted.

On the other, we could preserve the current convention again, and add a 
new dynamic variable which would be assigned in every relevant 
completion style, to store the rightmost-position (the length of 
suffix). Then the callers would fetch it from that variable. Similar to 
what we do with completion-lazy-hilit-fn now.

Or some variations of that.

But what I don't quite see yet, is why wouldn't the caller be able to 
compute the bounds cheaply enough? We could offer an accessor function. 
See the new logic in the attached patch (but imagine it extracted to a 
named function).

Note that it doesn't work too well now, because in the example like

   ~/v/e-|/src

the completions include the trailing slash. And base-suffix includes a 
starting slash as well (according to boundaries returned by the 
completion table). So when I choose one of the completions using 
minibuffer-next-completion, the minibuffer contents look like

   ~/v/emacs-master//src

...which translates to "/" because of the double slash -- the filesystem 
root directory (*). But that's the same data which would be used by any 
other proposed solution, too. So maybe it should be either be fixed in 
the completion table (avoid adding trailing slash when the last boundary 
is already followed by slash?), or the insertion code should do some 
additional post-processing of the completion string.

(*) And then, when I press tab while point is between slashes -- /|/ -- 
it jumps to the beginning of the input, but that's a secondary problem.
--------------bJEsTBOpw0RiDhC4vRhM2oUC
Content-Type: text/x-patch; charset=UTF-8; name="base-suffix.diff"
Content-Disposition: attachment; filename="base-suffix.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL2xpc3AvbWluaWJ1ZmZlci5lbCBiL2xpc3AvbWluaWJ1ZmZlci5lbApp
bmRleCAwYTg0NGM1MzhiNC4uMzNjMTc1YWEzYzYgMTAwNjQ0Ci0tLSBhL2xpc3AvbWluaWJ1
ZmZlci5lbAorKysgYi9saXNwL21pbmlidWZmZXIuZWwKQEAgLTI1ODIsMTYgKzI1ODIsMTMg
QEAgbWluaWJ1ZmZlci1jb21wbGV0aW9uLWhlbHAKICAgICAgICAgICAgICAobWluaWJ1ZmZl
ci1jb21wbGV0aW9uLWJhc2UgKHN1YnN0cmluZyBzdHJpbmcgMCBiYXNlLXNpemUpKQogICAg
ICAgICAgICAgIChiYXNlLXByZWZpeCAoYnVmZmVyLXN1YnN0cmluZyAobWluaWJ1ZmZlci0t
Y29tcGxldGlvbi1wcm9tcHQtZW5kKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAoKyBzdGFydCBiYXNlLXNpemUpKSkKLSAgICAgICAgICAgICAoYmFz
ZS1zdWZmaXgKLSAgICAgICAgICAgICAgKGlmIChvciAoZXEgKGFsaXN0LWdldCAnY2F0ZWdv
cnkgKGNkciBtZCkpICdmaWxlKQotICAgICAgICAgICAgICAgICAgICAgIGNvbXBsZXRpb24t
aW4tcmVnaW9uLW1vZGUtcHJlZGljYXRlKQotICAgICAgICAgICAgICAgICAgKGJ1ZmZlci1z
dWJzdHJpbmcKLSAgICAgICAgICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KLSAgICAgICAg
ICAgICAgICAgICAgIChpZiBjb21wbGV0aW9uLWluLXJlZ2lvbi1tb2RlLXByZWRpY2F0ZQot
ICAgICAgICAgICAgICAgICAgICAgICAgIChwb2ludCkKLSAgICAgICAgICAgICAgICAgICAg
ICAgKG9yIChzZWFyY2gtZm9yd2FyZCAiLyIgbmlsIHQpIChwb2ludC1tYXgpKSkpCi0gICAg
ICAgICAgICAgICAgICAgKHBvaW50LW1heCkpCi0gICAgICAgICAgICAgICAgIiIpKQorICAg
ICAgICAgICAgIChiYXNlLXN1ZmZpeCAobGV0ICgoc3VmZml4IChidWZmZXItc3Vic3RyaW5n
IChwb2ludCkgZW5kKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN1YnN0cmlu
ZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWZmaXgKKyAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgKGNkciAoY29tcGxldGlvbi1ib3VuZGFyaWVzIHN0cmluZworICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
bWluaWJ1ZmZlci1jb21wbGV0aW9uLXRhYmxlCisgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5pYnVmZmVyLWNvbXBsZXRpb24t
cHJlZGljYXRlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBzdWZmaXgpKSkpKQogICAgICAgICAgICAgIChhbGwtbWQgKGNvbXBs
ZXRpb24tLW1ldGFkYXRhIChidWZmZXItc3Vic3RyaW5nLW5vLXByb3BlcnRpZXMKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQgKHBvaW50KSkK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlLXNpemUg
bWQK

--------------bJEsTBOpw0RiDhC4vRhM2oUC--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.
Disconnected #49931 from all other report(s). Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 20 Mar 2022 20:35:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 20 16:35:32 2022
Received: from localhost ([127.0.0.1]:35204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nW2Gy-0004Oi-0n
	for submit <at> debbugs.gnu.org; Sun, 20 Mar 2022 16:35:32 -0400
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52967)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nW2Gw-0004OT-EV
 for 48356 <at> debbugs.gnu.org; Sun, 20 Mar 2022 16:35:31 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 4FDB860006;
 Sun, 20 Mar 2022 20:35:21 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
 <86r173odnm.fsf@HIDDEN>
Date: Sun, 20 Mar 2022 22:34:28 +0200
In-Reply-To: <86r173odnm.fsf@HIDDEN> (Juri Linkov's message of "Tue, 
 15 Mar 2022 09:53:01 +0200")
Message-ID: <868rt42wiz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>>> IMHO, the root of the problem is in completion-all-completions
>>>> that returns in the last `cdr' only the start of completions,
>>>> but not the end of completions.
>>>
>>> Agreed.
>>
>> If I recall correctly, someone wrote a patch which fixed the root cause.
>
> The only patch that removes these comments
>
>         ;; FIXME: We need to additionally return the info needed for the
>         ;; second part of completion-base-position.
>
>         ;; FIXME: We should pay attention to completion
>         ;; boundaries here, but currently
>         ;; completion-all-completions does not give us the
>         ;; necessary information.
>
> is https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00412.html
> in bug#47711 and bug#48841.

I wonder what is the fate of this patch?  There was a long discussion
without a clear outcome.  Maybe it's possible to split the patch
to smaller parts where a separate patch would add the feature needed here
to return the end position of the completion boundaries?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 15 Mar 2022 07:57:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 15 03:57:42 2022
Received: from localhost ([127.0.0.1]:47440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nU23p-0005GM-ST
	for submit <at> debbugs.gnu.org; Tue, 15 Mar 2022 03:57:42 -0400
Received: from relay11.mail.gandi.net ([217.70.178.231]:33523)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nU23n-0005G4-Br
 for 48356 <at> debbugs.gnu.org; Tue, 15 Mar 2022 03:57:40 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id A244C100007;
 Tue, 15 Mar 2022 07:57:29 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
 <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
Date: Tue, 15 Mar 2022 09:53:01 +0200
In-Reply-To: <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN> (Daniel
 Mendler's message of "Tue, 15 Mar 2022 03:14:15 +0100")
Message-ID: <86r173odnm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>> IMHO, the root of the problem is in completion-all-completions
>>> that returns in the last `cdr' only the start of completions,
>>> but not the end of completions.
>>
>> Agreed.
>
> If I recall correctly, someone wrote a patch which fixed the root cause.

The only patch that removes these comments

        ;; FIXME: We need to additionally return the info needed for the
        ;; second part of completion-base-position.

        ;; FIXME: We should pay attention to completion
        ;; boundaries here, but currently
        ;; completion-all-completions does not give us the
        ;; necessary information.

is https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00412.html
in bug#47711 and bug#48841.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 15 Mar 2022 02:14:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 22:14:35 2022
Received: from localhost ([127.0.0.1]:47096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTwhe-000462-RX
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 22:14:35 -0400
Received: from server.qxqx.de ([178.63.65.180]:39949 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nTwhd-00045p-3Z
 for 48356 <at> debbugs.gnu.org; Mon, 14 Mar 2022 22:14:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=yvSY8KST0ohNU6zfQmu9HJwdtkTMjN0CbscuVwWDV44=; b=PStxER5DMV0+qcl2u5aF0Tqmu8
 +lmZi1GzFdfNs0tQK4ijDlyGnyLc2OB8vmYxrAGhgNgv9+Xk/E83GhA8CDrW7EL1M6GPNZaPDVvvf
 j5RrPPx3RzaZ/94rpMuUuM7MKmuztnqd088FbHXfK58jKp++1etRddn2t7vP6WK0f87Y=;
Message-ID: <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
Date: Tue, 15 Mar 2022 03:14:15 +0100
MIME-Version: 1.0
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>, Juri Linkov <juri@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, "Stefan Monnier via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 3/14/22 21:55, Stefan Monnier wrote:
>> IMHO, the root of the problem is in completion-all-completions
>> that returns in the last `cdr' only the start of completions,
>> but not the end of completions.
> 
> Agreed.

If I recall correctly, someone wrote a patch which fixed the root cause.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Mar 2022 02:14:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 22:14:43 2022
Received: from localhost ([127.0.0.1]:47099 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTwhv-00046Z-7B
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 22:14:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:47038)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nTwht-00046Q-O4
 for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 22:14:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53786)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1nTwhs-0001cS-At
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 22:14:40 -0400
Received: from [2a01:4f8:121:346::180] (port=42539 helo=mail.qxqx.de)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1nTwhq-0001dx-61
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 22:14:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
 References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=yvSY8KST0ohNU6zfQmu9HJwdtkTMjN0CbscuVwWDV44=; b=PStxER5DMV0+qcl2u5aF0Tqmu8
 +lmZi1GzFdfNs0tQK4ijDlyGnyLc2OB8vmYxrAGhgNgv9+Xk/E83GhA8CDrW7EL1M6GPNZaPDVvvf
 j5RrPPx3RzaZ/94rpMuUuM7MKmuztnqd088FbHXfK58jKp++1etRddn2t7vP6WK0f87Y=;
Message-ID: <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@HIDDEN>
Date: Tue, 15 Mar 2022 03:14:15 +0100
MIME-Version: 1.0
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>, Juri Linkov <juri@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> <868rtcjqk4.fsf@HIDDEN>
 <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f8:121:346::180
 (failed)
Received-SPF: pass client-ip=2a01:4f8:121:346::180;
 envelope-from=mail@HIDDEN; helo=mail.qxqx.de
X-Spam_score_int: -33
X-Spam_score: -3.4
X-Spam_bar: ---
X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: 48356 <at> debbugs.gnu.org, "Stefan Monnier via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

On 3/14/22 21:55, Stefan Monnier wrote:
>> IMHO, the root of the problem is in completion-all-completions
>> that returns in the last `cdr' only the start of completions,
>> but not the end of completions.
> 
> Agreed.

If I recall correctly, someone wrote a patch which fixed the root cause.

Daniel




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 14 Mar 2022 20:55:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 16:55:57 2022
Received: from localhost ([127.0.0.1]:46394 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTrjR-0001LF-1Z
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 16:55:57 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12495)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nTrjO-0001Kn-2A
 for 48356 <at> debbugs.gnu.org; Mon, 14 Mar 2022 16:55:54 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1E3804419AA;
 Mon, 14 Mar 2022 16:55:48 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DACCF441998;
 Mon, 14 Mar 2022 16:55:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1647291346;
 bh=PyxzKwGSEc4hIufEKQROo9aMTey7+H45ueGVLiZtSuo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=COo5Pt6AkZxwIb+nAg6+gE+tX6Ml3tJ1kbkspvVHE1Mr3BPntdHjQhV4yaNb+j9vp
 mut51zSu4B0DsvgIx6fmcN+Fb/VfeJhxF9Aq1W/svRQM9nKBIiuhUbMde4m+CtC7Fw
 oGNOGfaU2Px0HoOwBHSsOaGjSkmN0mX3ePM5K4x+kmvtSWC7R56sxr5wyKF7zgYWy1
 mKX9MIkqK3Qropi2U8FDg5nuVeGfkL3GOUyTkWsJISMRF/RbyB8XtXnyQ+LmDCDsUQ
 axhCrsREIztZf6uBHX8khNjd2KSd9EOchI/O6dpL06f/MwrKWgFANCkQPHuxbgvMqV
 Y8kmK8XlE0yYA==
Received: from ceviche (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9CB94120384;
 Mon, 14 Mar 2022 16:55:46 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Message-ID: <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
Date: Mon, 14 Mar 2022 16:55:45 -0400
In-Reply-To: <868rtcjqk4.fsf@HIDDEN> (Juri Linkov's message of "Mon, 
 14 Mar 2022 20:53:15 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.057 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48356
Cc: Daniel Mendler <mail@HIDDEN>,
 "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, JD Smith <jdtsmith@HIDDEN>,
 48356 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> IMHO, the root of the problem is in completion-all-completions
> that returns in the last `cdr' only the start of completions,
> but not the end of completions.

Agreed.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Mar 2022 20:55:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 16:55:55 2022
Received: from localhost ([127.0.0.1]:46392 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTrjO-0001L6-Q9
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 16:55:55 -0400
Received: from lists.gnu.org ([209.51.188.17]:57546)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nTrjN-0001Ku-HK
 for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 16:55:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52966)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1nTrjN-0002HH-7j
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 16:55:53 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15271)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1nTrjK-0004b0-Ff
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 16:55:52 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1E3804419AA;
 Mon, 14 Mar 2022 16:55:48 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DACCF441998;
 Mon, 14 Mar 2022 16:55:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1647291346;
 bh=PyxzKwGSEc4hIufEKQROo9aMTey7+H45ueGVLiZtSuo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=COo5Pt6AkZxwIb+nAg6+gE+tX6Ml3tJ1kbkspvVHE1Mr3BPntdHjQhV4yaNb+j9vp
 mut51zSu4B0DsvgIx6fmcN+Fb/VfeJhxF9Aq1W/svRQM9nKBIiuhUbMde4m+CtC7Fw
 oGNOGfaU2Px0HoOwBHSsOaGjSkmN0mX3ePM5K4x+kmvtSWC7R56sxr5wyKF7zgYWy1
 mKX9MIkqK3Qropi2U8FDg5nuVeGfkL3GOUyTkWsJISMRF/RbyB8XtXnyQ+LmDCDsUQ
 axhCrsREIztZf6uBHX8khNjd2KSd9EOchI/O6dpL06f/MwrKWgFANCkQPHuxbgvMqV
 Y8kmK8XlE0yYA==
Received: from ceviche (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9CB94120384;
 Mon, 14 Mar 2022 16:55:46 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Message-ID: <jwvy21cckzk.fsf-monnier+emacs@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
 <868rtcjqk4.fsf@HIDDEN>
Date: Mon, 14 Mar 2022 16:55:45 -0400
In-Reply-To: <868rtcjqk4.fsf@HIDDEN> (Juri Linkov's message of "Mon, 
 14 Mar 2022 20:53:15 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.057 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Daniel Mendler <mail@HIDDEN>,
 "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>, JD Smith <jdtsmith@HIDDEN>,
 48356 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

> IMHO, the root of the problem is in completion-all-completions
> that returns in the last `cdr' only the start of completions,
> but not the end of completions.

Agreed.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 14 Mar 2022 19:16:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 15:16:52 2022
Received: from localhost ([127.0.0.1]:46322 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTqBY-00074G-HF
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 15:16:52 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:42377)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nTqBW-00073o-TA
 for 48356 <at> debbugs.gnu.org; Mon, 14 Mar 2022 15:16:51 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 60589240006;
 Mon, 14 Mar 2022 19:16:42 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
Date: Mon, 14 Mar 2022 20:53:15 +0200
In-Reply-To: <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Sun, 13 Mar 2022 23:10:11 -0400")
Message-ID: <868rtcjqk4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: Daniel Mendler <mail@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, JD Smith <jdtsmith@HIDDEN>,
 48356 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> For example when completing a file path "~/emacs/master/li|/calc", where
>> "|" is the cursor, and then the candidate "lisp" is selected in the
>> *Completions* buffer, the result is "~/emacs/master/lisp/". The prefix
>> "~/emacs/master/" is prepended to the selected candidate, but the suffix
>> "/calc" is discarded.
>
> Yup.  That's listed under "bugs" at the beginning of minibuffer.el:
>
>     ;; - choose-completion can't automatically figure out the boundaries
>     ;;   corresponding to the displayed completions because we only
>     ;;   provide the start info but not the end info in
>     ;;   completion-base-position.
>
>> ... and the suffix is preserved.
>
> Of course, the suffix should *not* be preserved when the minibuffer was
> "r|e-buf".

IMHO, the root of the problem is in completion-all-completions
that returns in the last `cdr' only the start of completions,
but not the end of completions.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Mar 2022 19:16:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 14 15:16:51 2022
Received: from localhost ([127.0.0.1]:46320 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTqBX-000743-7P
	for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 15:16:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:46872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1nTqBV-00073w-RH
 for submit <at> debbugs.gnu.org; Mon, 14 Mar 2022 15:16:50 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33546)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1nTqBV-0007Ez-Me
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 15:16:49 -0400
Received: from [2001:4b98:dc4:8::221] (port=60369 helo=relay1-d.mail.gandi.net)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1nTqBT-0006rk-OJ
 for bug-gnu-emacs@HIDDEN; Mon, 14 Mar 2022 15:16:49 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 60589240006;
 Mon, 14 Mar 2022 19:16:42 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
Date: Mon, 14 Mar 2022 20:53:15 +0200
In-Reply-To: <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Sun, 13 Mar 2022 23:10:11 -0400")
Message-ID: <868rtcjqk4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:4b98:dc4:8::221
 (failed)
Received-SPF: pass client-ip=2001:4b98:dc4:8::221;
 envelope-from=juri@HIDDEN; helo=relay1-d.mail.gandi.net
X-Spam_score_int: -10
X-Spam_score: -1.1
X-Spam_bar: -
X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: submit
Cc: Daniel Mendler <mail@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, JD Smith <jdtsmith@HIDDEN>,
 48356 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

>> For example when completing a file path "~/emacs/master/li|/calc", where
>> "|" is the cursor, and then the candidate "lisp" is selected in the
>> *Completions* buffer, the result is "~/emacs/master/lisp/". The prefix
>> "~/emacs/master/" is prepended to the selected candidate, but the suffix
>> "/calc" is discarded.
>
> Yup.  That's listed under "bugs" at the beginning of minibuffer.el:
>
>     ;; - choose-completion can't automatically figure out the boundaries
>     ;;   corresponding to the displayed completions because we only
>     ;;   provide the start info but not the end info in
>     ;;   completion-base-position.
>
>> ... and the suffix is preserved.
>
> Of course, the suffix should *not* be preserved when the minibuffer was
> "r|e-buf".

IMHO, the root of the problem is in completion-all-completions
that returns in the last `cdr' only the start of completions,
but not the end of completions.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 14 Mar 2022 03:10:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 13 23:10:23 2022
Received: from localhost ([127.0.0.1]:43676 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTb6F-0007A3-71
	for submit <at> debbugs.gnu.org; Sun, 13 Mar 2022 23:10:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nTb6C-00079q-QV
 for 48356 <at> debbugs.gnu.org; Sun, 13 Mar 2022 23:10:21 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8F930805E6;
 Sun, 13 Mar 2022 23:10:14 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0F5A880306;
 Sun, 13 Mar 2022 23:10:13 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1647227413;
 bh=z67s/zP/voK3hxYlwUKV5WH+9fgwOTkrrVPLxpE+Gbo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=pgonwvvnii3q94Hu3Smff4gQps95rIuTpMM2INta5aW5cFktXInzu2t/eR/PWV+uC
 5PwNr0u6x+ZugUPvT3d7ggHNTcUdG3I+Zjk6EZS7cshQrV2mXnruJ1wCtISqczrnrs
 m31eQev5cDlGwxED7j09PhIQXeNLrzZf+aD8aE6YWd1QKcB+Z+fBZnesWfim5bnIO4
 eXYeQ7zMpLYZlmfnM9QDXxGg0AI/mYc9n5eYxU/L6f8iTAw4ebamFj2jt4dR7SFCFs
 m+drxhsJ4nwU3+XCAXBy9ky6denyN4nUunZRmPfNODD89S5myDWdyvXWDipHF5K4KG
 frnIyd6Hjpmmw==
Received: from ceviche (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D036F120370;
 Sun, 13 Mar 2022 23:10:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: 28.0.50; choose-completion discards the suffix after the
 completion boundary
Message-ID: <jwv1qz5grrf.fsf-monnier+emacs@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
Date: Sun, 13 Mar 2022 23:10:11 -0400
In-Reply-To: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN> (Daniel
 Mendler's message of "Tue, 11 May 2021 19:23:13 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.059 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> For example when completing a file path "~/emacs/master/li|/calc", where
> "|" is the cursor, and then the candidate "lisp" is selected in the
> *Completions* buffer, the result is "~/emacs/master/lisp/". The prefix
> "~/emacs/master/" is prepended to the selected candidate, but the suffix
> "/calc" is discarded.

Yup.  That's listed under "bugs" at the beginning of minibuffer.el:

    ;; - choose-completion can't automatically figure out the boundaries
    ;;   corresponding to the displayed completions because we only
    ;;   provide the start info but not the end info in
    ;;   completion-base-position.

> ... and the suffix is preserved.

Of course, the suffix should *not* be preserved when the minibuffer was
"r|e-buf".


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 13 Mar 2022 20:35:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 13 16:35:59 2022
Received: from localhost ([127.0.0.1]:43415 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTUwY-0003gX-Rc
	for submit <at> debbugs.gnu.org; Sun, 13 Mar 2022 16:35:59 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:19678)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1nTUwV-0003g9-1l
 for 48356 <at> debbugs.gnu.org; Sun, 13 Mar 2022 16:35:56 -0400
Received: from pps.filterd (m0246631.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22DBKeNa010652; 
 Sun, 13 Mar 2022 20:35:49 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=from : to : cc :
 subject : date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=corp-2021-07-09;
 bh=jlGtnzWxTP9BZ7YHhH8Bm2MnPHur2ZA+Fqa0DVBLYcw=;
 b=PFHhEZAPy3yB/YL8x08CCv3Uy81qAMXywq2lhm435//RnXwqTttuKSAz+f8mnBox7nj7
 xQFvnkf05nDSA9fW6prcYKyXWHl8/VhKxAEU8dxHlIHXKNPLcsteGMmrLxO6DqsEUT9G
 SLdfxxrt+30Nix72AUylznG0CLmhvtF2rvwWMQ+vmKpuoXudSwpWrLhTyeZ31pFCm6wm
 JbFJ2WIcpCQ3WX91TmxWBQYCxc2LNeq0xF5/iSuzxtttT9VM1kmRpGYYpGxFb37iyty0
 khPdff6aTm1wfjV+rSLCr6sJcx1i5axXL8B8YT8E8M9fTiDmsNFZ8o2xrLG3dS0R2Dhg OA== 
Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80])
 by mx0b-00069f02.pphosted.com with ESMTP id 3erja2a21v-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sun, 13 Mar 2022 20:35:48 +0000
Received: from pps.filterd (userp3030.oracle.com [127.0.0.1])
 by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 22DKGoGe094777;
 Sun, 13 Mar 2022 20:35:47 GMT
Received: from nam10-dm6-obe.outbound.protection.outlook.com
 (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107])
 by userp3030.oracle.com with ESMTP id 3ergmrxusy-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Sun, 13 Mar 2022 20:35:47 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Qqga19ZcWAmnECYA26aTqqHpzgjPgRVL/vEnssxzLE8/3FGlFlRIkEniP3n2OjDn85tL9cjDUbq+s1Xl+cqqPhgX57gAoMVHFluWmBbsBMWC9LehJpaVi4OI8xL7pXsEzXX3ekElzH22N0XjX3QeOmcUFDSr2uDHx5Aaxq2nb5MqLobX1x8QyOs8f7sJhxE8S27419U1b9qRVnfOchVeTbhiFlwOESthOxrdViG4iovRPsUKdniCWSwpveOVRCsgTiiULFlP+Dv3JBgAOVpxGC2kARreJORVnJJgm1to+vCB67imVUMrFfoa+NzObVZESafUdbqPhIRxr/2oHKqHqA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jlGtnzWxTP9BZ7YHhH8Bm2MnPHur2ZA+Fqa0DVBLYcw=;
 b=jmoZGeTkEKvYFEOrumlXMAhpUM+y9r3kvkkws3TyjsSdJ4R8BM3eTm6KgXBuSBnDuOsAUWOSa1Q1wdnjUiMNI1D8aue8oZ5Qt0dtCHgzQslsWLk2wjd8Bd3nnM5yWKi7FA71hvVfjgSDEoEdquaMqZKSC35+N3mdwnsHZYXJfwp0xVS+kOhA508dMoDnR1va0+h8e1VmubTPTW8ZUH+Ztfdhwm5Vo17cBjOxu4kT6fAqFA08WQWe1lf4Bh5YcJMDD6DsWacBYye3NhGuAHZxv19zy0w07jUGdfsDmJYvibfFyT36+wFCi1SvHaTmfhpgY4CJ/+1c9ENdqSRA2SKlLw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jlGtnzWxTP9BZ7YHhH8Bm2MnPHur2ZA+Fqa0DVBLYcw=;
 b=GCjZz5EB+xMqFYocXX++11dl2QTgAqcinsb5oMy5N/K3ymW2+XbLxcJWOktV2Ez0Tjwn1QMNMgpN+Ex21m8y7GU25Hmji1bzREC3Bkr44/GmOARNf6VMksE3UpMISTRvpN8R9GIuY/T+EoKBMGm/c5R/C4g4X64nraNZeQL4S+s=
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19)
 by MWHPR10MB2030.namprd10.prod.outlook.com (2603:10b6:300:10d::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.24; Sun, 13 Mar
 2022 20:35:45 +0000
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::ec69:8077:89b0:4379]) by SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::ec69:8077:89b0:4379%6]) with mapi id 15.20.5061.028; Sun, 13 Mar 2022
 20:35:45 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Juri Linkov <juri@HIDDEN>, Daniel Mendler <mail@HIDDEN>
Subject: RE: [External] : bug#48356: 28.0.50; choose-completion discards the
 suffix after the completion boundary
Thread-Topic: [External] : bug#48356: 28.0.50; choose-completion discards the
 suffix after the completion boundary
Thread-Index: AQHYNwZeXxR8Ct6le0GPsZWrGCkMj6y9vTog
Date: Sun, 13 Mar 2022 20:35:45 +0000
Message-ID: <SJ0PR10MB54888C2B211394E88059A25FF30E9@HIDDEN>
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
 <865yoh91nh.fsf@HIDDEN>
In-Reply-To: <865yoh91nh.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: e0c08c46-c120-4ffe-6e09-08da05310ccb
x-ms-traffictypediagnostic: MWHPR10MB2030:EE_
x-microsoft-antispam-prvs: <MWHPR10MB2030E7BE060A8D826E348798F30E9@HIDDEN>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: qC/On7rifuINZer35u3pMIJiR9+TRoSLaFGRjw2JwGv6xIXNvFTTaiE7mWF+J5qoeyZIkA01hu6gow3HXntG60lNqXmp47hH9crCUOq3F04HpkueUWBH5vk2gzLRA5INtU5R5FghVNgkvh9ySXv/YZUCWzokGK2e0voyxbW/nF4Gr6tB9Ye2YYQ+Ab2RAcaNW8jcRjZgIYVbl0VCm7GKIapWsltHTSBIebMWN9MFiDk3yPsnM2fKGM90Lcp3WS4s+o+zLxxV5tZXWFMRNI7N55rsmlr/jX0N5H8FkRx5cF7i+HpKlEPcOj9C0fkVvzJFcksMhh7BsI8AX1hNJs1nVq3pMq8WekRIZasJiUz/GEPut2/a3Szr3H0X70EjK5Y952ZnNbCyFn0+iIi/2hSklX/51elX1WMDX94Axatd2A6UtOeJ7HDh8rL0r2aCWD3P4Zz14L3yZkik4tWK6HkvvIwcTPHcX+SLh9z9PCt2rEOdhPoLQlvoIIOQjzbAxxmifhP6BND2wybKRWQLXr4Nfz5G1uaF+FYjrFEyMwxKNoDhcFd2fraW+dP/o5zYGogPTWkYZYh0WWp4aKt6WDBGlry2Lo2MJMxHGpFSlcciXG6YvG+ep/5pHy9LU24tOW//pb9suDqyElVJmbuLCy20B2A1f+zl9kfRJubIXAFR+QTr5QFwAS5YTl4xzhuzqCeKarOpk+EYC3eYb8nP/hTO4Q==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230001)(366004)(64756008)(66446008)(4326008)(8676002)(66556008)(122000001)(38100700002)(186003)(83380400001)(26005)(86362001)(9686003)(7696005)(6506007)(55016003)(508600001)(38070700005)(316002)(54906003)(110136005)(33656002)(66946007)(76116006)(8936002)(52536014)(66476007)(44832011)(2906002)(5660300002)(71200400001);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?eMsKe4lnHzXZGi2Tk+fhbpkn6EJreiFSrAzBBLieq3JQ5uuTq4C7DbUGRUIL?=
 =?us-ascii?Q?+5SrrQFQRxOp7XfJN++CntHtqHkzHJ/pb/6MlJ2LL7pQ5m5z3iU3kbcr26Am?=
 =?us-ascii?Q?Jfy69T+2CaFmmcdslz2dnPV0hg9U+6kSIuFwyghhcWiwRjiTJKPruUwS5zcC?=
 =?us-ascii?Q?p6fGrHjvFAII8s34fsJOaPLcuy3Kg8+07/hc0p3FbNEvWHd4elQV0HJO69lh?=
 =?us-ascii?Q?m7psrJQLEv90VYuua1Jq1IXf7PqVRZskg+v3cqGwe5u1K9+TuzW25ZuPSJ1t?=
 =?us-ascii?Q?G1dik2OFA/+LKGsQ7ufaKF+1LKXgzY1gf4hLMwXxxqDW+AMSWTmyg6fcTzzb?=
 =?us-ascii?Q?OLbHFIC5sahUf9LVDGeBfiI9NS9eSYeZ5Vp/TtZHwF5VsDZ5pXgNsYILZLY+?=
 =?us-ascii?Q?Lqm5HqGzGcrAJiQ9NrWN5zZmgGt3z4nlrJ/f5X6h8xRD9juhAPrrMkujDI6T?=
 =?us-ascii?Q?mXn2eHRoe+gyCsnE7G9zLUK22UwmpO6K1yTUvfM5crzVmvgXi4mJ9w9vUZW4?=
 =?us-ascii?Q?5+x/FTAcCaFHhYizEuscjNYK+ge0Len/POX3nbayEkKWpe8d7gljPiLtgHJW?=
 =?us-ascii?Q?8D/ncDIgXYp8H7CnCG6XaRJ1Y76xDRTCjKracV9QUwGm380ewbGTY2kWEOjx?=
 =?us-ascii?Q?t/M4y2UMja56+3ziUXU8zz5PJbRW3qFvkhFNvYpRakkDw0APt/FGbyY9qFq+?=
 =?us-ascii?Q?i8khaN1wLkvpTAhP2njSpo7eBcLTgaqkITlB7r0eKCn7a+2L0s/y2RE2EEuc?=
 =?us-ascii?Q?AHmnd4RMd+cEES//fwraSkJkYI/B/AQ6iELAempY9e1OMDWBifrw/V0p+X6x?=
 =?us-ascii?Q?jiFrE15S/GzD3tAwN/dxFqgamfJjrEXz5KzEUTYllS4g/0l4k4u7AvUpaP0I?=
 =?us-ascii?Q?6V49tXNW+gbgdAxjdtR+cF2TEqLSEgo8Cwvl6WmjGkI9U4mD4TdWGbW3Pwr3?=
 =?us-ascii?Q?19XaD19Al64d0vvPQb8y2HmbcODz2rgX48pc7w9QF8f0aw6ibRda4xiqQmto?=
 =?us-ascii?Q?3yid4kBqhGetYMOH/9cleXMlxr7QwKiw5qZQteMRgBbw+98GjhRs6mCgqpzP?=
 =?us-ascii?Q?8WA/3+I8dfLIRqEmMD7q2v+cow/HP3igu+wCTtCxNAJBsGX/pBbMs1BfOVNd?=
 =?us-ascii?Q?UhMO7utvrCYe42hSB9aLeGQp6R+hn5ButpOJDbtgzz5oVdd7p6w0m5x1NZEB?=
 =?us-ascii?Q?/6TTHnmsNuHiATH02tgGp97DgyjSiNELqRJugihrKC4cKASJBTQ9fBOK43L/?=
 =?us-ascii?Q?09UT+6yptjFWNbnGWHs/TE/SJKMwwZIhabWskaXAM59TWTk72D2J8g17M0Dy?=
 =?us-ascii?Q?PdiTb055S4A8r1K0847vsUx+qpkKqqFp6fMe378x+rTIFOrBYMe2tGpsXrVY?=
 =?us-ascii?Q?BBZ7NZwe+td+zo1jrsD/oqOoa8MKu12TBqtC59nUlLo5PIinu39SkJEGGZ4i?=
 =?us-ascii?Q?Wn1bj37czWVzMndmOStiLIR6h3dPCNh2?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e0c08c46-c120-4ffe-6e09-08da05310ccb
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2022 20:35:45.1917 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: TY6u3fUQEPOu9PS6SVyfno773vTteSLbUZqTnxtfxbqC1gDFTXvw55UURXbnMnMec4lopErsnLlhfGOFt2P0Qg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB2030
X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10285
 signatures=693139
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0
 mlxscore=0 phishscore=0
 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 mlxlogscore=849
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000
 definitions=main-2203130126
X-Proofpoint-ORIG-GUID: 9MVtE6F038sQudgTeF8aIgYTIYKXEIwh
X-Proofpoint-GUID: 9MVtE6F038sQudgTeF8aIgYTIYKXEIwh
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: "48356 <at> debbugs.gnu.org" <48356 <at> debbugs.gnu.org>,
 Stefan Monnier <monnier@HIDDEN>, JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

FWIW, my opinion (no doubt a minority of one)
is that all such approaches, including what's
in vanilla Emacs now (since `minibuffer.el',
which I guess means Emacs 22/23), are inferior
to the original vanilla behavior.

Icicles uses that original behavior, in which
it _makes no difference where point is_ in
the minibuffer content.

That is, the entire minibuffer content is the
pattern to be matched (whether for completion
or reading by `read-from-minibuffer' etc.).

I find this more flexible & saner - doesn't
matter where point is.  Whether or not you've
made an edit in the middle of the content,
e.g. yanking or typing or deleting there, all
of the current text is used.

If someone really ever wants the text that
follows point not to be taken into account
then it's simple enough to hit a key to remove
it (and it can be restored with undo etc.).

You may say it's also simple enough otherwise
to move point to the end of input (e.g. `M-v').
Fair enough, but I think that's more bother.

It's more common, I think, to edit text in the
middle somewhere, and then either keep the
text that follows point or kill/delete it.

There's never any need to move point just to
get the pattern you want.  You never need to
pay any attention to point in the minibuffer.
___

[I suppose that in some sense this is kind of
a bottle half-full/half-empty choice.  Maybe
akin to views on `delete-selection-mode':
convenience of not having to first use `C-w'
(to replace) versus convenience of not having
to first use `C-g' (to not replace).]






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.
Forcibly Merged 48356 49931. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 48356 <at> debbugs.gnu.org:


Received: (at 48356) by debbugs.gnu.org; 13 Mar 2022 18:13:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 13 14:13:51 2022
Received: from localhost ([127.0.0.1]:43260 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nTSj1-00066V-BG
	for submit <at> debbugs.gnu.org; Sun, 13 Mar 2022 14:13:51 -0400
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:51379)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1nTSj0-00066B-7O; Sun, 13 Mar 2022 14:13:51 -0400
Received: (Authenticated sender: juri@HIDDEN)
 by mail.gandi.net (Postfix) with ESMTPSA id 7BA581C0004;
 Sun, 13 Mar 2022 18:13:41 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Daniel Mendler <mail@HIDDEN>
Subject: Re: bug#48356: 28.0.50; choose-completion discards the suffix after
 the completion boundary
Organization: LINKOV.NET
References: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
Date: Sun, 13 Mar 2022 19:56:50 +0200
In-Reply-To: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN> (Daniel
 Mendler's message of "Tue, 11 May 2021 19:23:13 +0200")
Message-ID: <865yoh91nh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 48356
Cc: 48356 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

forcemerge 48356 49931
thanks

> When selecting a candidate the suffix after the completion boundary is
> discarded by `choose-completion`/`choose-completion-string`.
> `choose-completion` is invoked when a candidate in the *Completions*
> buffer is selected with the mouse or RET.
>
> For example when completing a file path "~/emacs/master/li|/calc", where
> "|" is the cursor, and then the candidate "lisp" is selected in the
> *Completions* buffer, the result is "~/emacs/master/lisp/". The prefix
> "~/emacs/master/" is prepended to the selected candidate, but the suffix
> "/calc" is discarded.
>
> `choose-completion-string` contains logic which checks if the resulting
> string equals the car of the completion boundary. In that case the
> minibuffer is not exited.

Strange, in your test case above, the minibuffer is not exited already.

> I propose the following change to the existing logic: When
> selecting a candidate with `choose-completion` and a suffix is present,
> the minibuffer should not be exited (completion continues) and the
> suffix is preserved.

Here is a better patch than was posted to bug#49931
to preserve the suffix.

It correctly handles at least three different cases:

1. When manually adding a suffix in the minibuffer after completions
   were displayed, choose-completion discards that suffix.

2. In file name completion in the above case the suffix is preserved.

3. 'M-! command filename TAB' and choosing a completion preserves both
   prefix and suffix.

This works only after customizing 'completion-use-base-affixes' to t:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=completion-base-affixes.patch

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 36b8d80841..5685f078ad 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2227,6 +2312,8 @@ minibuffer-completion-help
       (let* ((last (last completions))
              (base-size (or (cdr last) 0))
              (prefix (unless (zerop base-size) (substring string 0 base-size)))
+             (base-prefix (buffer-substring (minibuffer--completion-prompt-end) (+ start base-size)))
+             (base-suffix (buffer-substring (point) (point-max)))
              (all-md (completion--metadata (buffer-substring-no-properties
                                             start (point))
                                            base-size md
@@ -2320,11 +2407,18 @@ minibuffer-completion-help
                                    ;; completion-all-completions does not give us the
                                    ;; necessary information.
                                    end))
+                        (setq-local completion-base-affixes (list base-prefix base-suffix))
                         (setq-local completion-list-insert-choice-function
                              (let ((ctable minibuffer-completion-table)
                                    (cpred minibuffer-completion-predicate)
                                    (cprops completion-extra-properties))
                                (lambda (start end choice)
+                                 (if (and (stringp start) (stringp end))
+                                     (progn
+                                       (delete-minibuffer-contents)
+                                       (insert start choice)
+                                       ;; Keep point after completion before suffix
+                                       (save-excursion (insert end)))
                                  (unless (or (zerop (length prefix))
                                              (equal prefix
                                                     (buffer-substring-no-properties
@@ -2333,7 +2427,7 @@ minibuffer-completion-help
                                                      start)))
                                    (message "*Completions* out of date"))
                                  ;; FIXME: Use `md' to do quoting&terminator here.
-                                 (completion--replace start end choice)
+                                 (completion--replace start end choice))
                                  (let* ((minibuffer-completion-table ctable)
                                         (minibuffer-completion-predicate cpred)
                                         (completion-extra-properties cprops)
diff --git a/lisp/simple.el b/lisp/simple.el
index accc119e2b..52cf54c563 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -9071,6 +9075,19 @@ completion-base-position
 where the completion should be inserted and END (if non-nil) is the end
 of the text to replace.  If END is nil, point is used instead.")
 
+(defvar completion-base-affixes nil
+  "Base context of the text corresponding to the shown completions.
+This variable is used in the *Completions* buffers.
+Its value is a list of the form (PREFIX SUFFIX) where PREFIX is the text
+before the place where completion should be inserted and SUFFIX is the text
+after the completion.")
+
+(defcustom completion-use-base-affixes nil
+  "Non-nil means to restore original prefix and suffix in the minibuffer."
+  :type 'boolean
+  :version "29.1"
+  :group 'completion)
+
 (defvar completion-list-insert-choice-function #'completion--replace
   "Function to use to insert the text chosen in *Completions*.
 Called with three arguments (BEG END TEXT), it should replace the text
@@ -9151,6 +9168,7 @@ next-completion
   (with-current-buffer (window-buffer (posn-window (event-start event)))
     (let ((buffer completion-reference-buffer)
           (base-position completion-base-position)
+          (base-affixes completion-base-affixes)
           (insert-function completion-list-insert-choice-function)
           (choice
            (save-excursion
@@ -9184,7 +9203,8 @@ choose-completion
       (with-current-buffer buffer
         (choose-completion-string
          choice buffer
-         (or base-position
+         (or (and completion-use-base-affixes base-affixes)
+             base-position
              ;; If all else fails, just guess.
              (list (choose-completion-guess-base-position choice)))
          insert-function)))))
@@ -9344,9 +9372,11 @@ completion-setup-function
                 (buffer-substring (minibuffer-prompt-end) (point)))))))
     (with-current-buffer standard-output
       (let ((base-position completion-base-position)
+            (base-affixes completion-base-affixes)
             (insert-fun completion-list-insert-choice-function))
         (completion-list-mode)
         (setq-local completion-base-position base-position)
+        (setq-local completion-base-affixes base-affixes)
         (setq-local completion-list-insert-choice-function insert-fun))
       (setq-local completion-reference-buffer mainbuf)
       (if base-dir (setq default-directory base-dir))

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 May 2021 17:23:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 11 13:23:23 2021
Received: from localhost ([127.0.0.1]:37262 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lgW6M-0006xr-UU
	for submit <at> debbugs.gnu.org; Tue, 11 May 2021 13:23:23 -0400
Received: from lists.gnu.org ([209.51.188.17]:40968)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1lgW6L-0006xj-9f
 for submit <at> debbugs.gnu.org; Tue, 11 May 2021 13:23:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57900)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1lgW6L-0001DX-3U
 for bug-gnu-emacs@HIDDEN; Tue, 11 May 2021 13:23:21 -0400
Received: from server.qxqx.de ([2a01:4f8:121:346::180]:54051 helo=mail.qxqx.de)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1lgW6H-0001wq-KR
 for bug-gnu-emacs@HIDDEN; Tue, 11 May 2021 13:23:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de;
 s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:
 Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=RRIuxG+AHTSaEjSDSTknE/BtjfH7ugj6Ju4onnmgL8o=; b=tCtoNsVCrlhWhVeqhWs9PKSzTq
 mR4CW6uu9QMjJdBayUc4vT+ooLwuctYZDiWZh5ZJRDSib1+9Oh6AAoa7IAJZysw/bHTDHtXn69u5p
 KwtAf2Zk2gODYIFVRY5zmkhvHIA7e8hKGCM9z8U3OpcRyqA9k9XQlxZeg4ceC3xAk6MU=;
To: bug-gnu-emacs@HIDDEN
From: Daniel Mendler <mail@HIDDEN>
Subject: 28.0.50; choose-completion discards the suffix after the completion
 boundary
Message-ID: <18593691-8b7a-facf-68e1-e9d0c106897b@HIDDEN>
Date: Tue, 11 May 2021 19:23:13 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a01:4f8:121:346::180;
 envelope-from=mail@HIDDEN; helo=mail.qxqx.de
X-Spam_score_int: -41
X-Spam_score: -4.2
X-Spam_bar: ----
X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: Stefan Monnier <monnier@HIDDEN>, JD Smith <jdtsmith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

When selecting a candidate the suffix after the completion boundary is
discarded by `choose-completion`/`choose-completion-string`.
`choose-completion` is invoked when a candidate in the *Completions*
buffer is selected with the mouse or RET.

For example when completing a file path "~/emacs/master/li|/calc", where
"|" is the cursor, and then the candidate "lisp" is selected in the
*Completions* buffer, the result is "~/emacs/master/lisp/". The prefix
"~/emacs/master/" is prepended to the selected candidate, but the suffix
"/calc" is discarded.

`choose-completion-string` contains logic which checks if the resulting
string equals the car of the completion boundary. In that case the
minibuffer is not exited.

I propose the following change to the existing logic: When
selecting a candidate with `choose-completion` and a suffix is present,
the minibuffer should not be exited (completion continues) and the
suffix is preserved.




Acknowledgement sent to Daniel Mendler <mail@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#48356; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 18 Apr 2024 14:30:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.