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.
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: Tue, 5 Apr 2022 18:30:02 UTC

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