GNU logs - #55205, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 08:29:02 +0000
Resent-Message-ID: <handler.55205.B.165139370231009 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 55205 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier@HIDDEN>
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.165139370231009
          (code B ref -1); Sun, 01 May 2022 08:29:02 +0000
Received: (at submit) by debbugs.gnu.org; 1 May 2022 08:28:22 +0000
Received: from localhost ([127.0.0.1]:59458 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl4wH-000845-PY
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 04:28:22 -0400
Received: from lists.gnu.org ([209.51.188.17]:40870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl4wH-00083z-3J
 for submit <at> debbugs.gnu.org; Sun, 01 May 2022 04:28:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56934)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>)
 id 1nl4wG-0000vP-RM
 for bug-gnu-emacs@HIDDEN; Sun, 01 May 2022 04:28:20 -0400
Received: from server.qxqx.de ([2a01:4f8:121:346::180]:52655 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 1nl4wE-0004WY-ET
 for bug-gnu-emacs@HIDDEN; Sun, 01 May 2022 04:28: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:Subject:Cc:From:To
 :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:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=d2X/JJ/mrK6hEkQfHUbeW9ZsJPSGCdASTC38Dvi72l0=; b=d1GFbzBJP6DxJ9pmjM3HLCvz+W
 +Q2/ev3e0pXdCixVINR/1sjyLDjwkXCsQRP40SRbvDSPcRNV8yT6KeLlBtlfkbMUBdEOzKtwXLnWs
 e2FlRiLG5dCIXOyt7h9xZLU//aIk7RB85d8NchVKvRkDqdkqOGGna8BEcezriR4zOC7M=;
Message-ID: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
Date: Sun, 1 May 2022 10:27:56 +0200
MIME-Version: 1.0
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
Content-Type: text/plain; charset=UTF-8
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,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
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 (--)

The function completion--replace mutates the replacement string, it
strips the text properties. The command minibuffer-force-complete calls
(completion--replace base end (car all)) on the first candidate returned
by completion-all-sorted-completions, which then affects the candidate
strings passed to completing-read. The candidate strings passed to
completing-read should be treated as constant and should not be mutated.

There are two possibilities to fix this:

1. Copy the string (with concat or substring) before mutating it in
completion--replace. This is the preferred solution and will make
completion--replace safer to use.
2. Copy the candidate string just before passing it to
completion--replace. This is the approach I take for example in my Corfu
package and I will continue to do so for backward compatibility. Still,
the pattern is error prone and copying the candidate string is easily
forgotten, (completion--replace beg end (concat cand)).

Original downstream issue: https://github.com/minad/consult/issues/566

In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw scroll bars)
 of 2022-04-29 built on projects
Repository revision: 3b6338c8c351cce721f2f1aa115cadc401179d5c
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Daniel Mendler <mail@HIDDEN>
Subject: bug#55205: Acknowledgement (28.1.50; completion--replace
 illegally mutates completion candidates)
Message-ID: <handler.55205.B.165139370231009.ack <at> debbugs.gnu.org>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
X-Gnu-PR-Message: ack 55205
X-Gnu-PR-Package: emacs
Reply-To: 55205 <at> debbugs.gnu.org
Date: Sun, 01 May 2022 08:29:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 55205 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
55205: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55205
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 11:55:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140605422442 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140605422442
          (code B ref 55205); Sun, 01 May 2022 11:55:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 11:54:14 +0000
Received: from localhost ([127.0.0.1]:59785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl89W-0005pu-LN
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 07:54:14 -0400
Received: from quimby.gnus.org ([95.216.78.240]:58492)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nl89V-0005pg-5Z
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 07:54:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=E04wHvcGcAbIkiTi6WPlsVqRsUJt5zTjYXBFqVFmmuQ=; b=n3PBY8QpR0r7BRdh4VM27rW27q
 Pwrh32ul6YJjvDVYM1X0J/qgwFb4h/GWhS2OOKvxDfTkqy1PqBB6AAXne+ExM3cZmbcyQZEcAKxyR
 2saWf8xd5e+/hydleD7qd8PbfqhBABFMlHGEuMok1HrzQWc5kvZhDrEmBmeuSyHSf9rA=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nl89K-0003vc-Q0; Sun, 01 May 2022 13:54:05 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
X-Now-Playing: Colleen's _A Flame My Love, A Frequency_: "Summer Night (Bat
 Song)"
Date: Sun, 01 May 2022 13:53:59 +0200
In-Reply-To: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN> (Daniel
 Mendler's message of "Sun, 1 May 2022 10:27:56 +0200")
Message-ID: <87wnf5mpt4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Daniel Mendler <mail@HIDDEN> writes: > The
 function
 completion--replace mutates the replacement string, it > strips the text
 properties. I don't think that's, strictly speaking, illegal. :-) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Daniel Mendler <mail@HIDDEN> writes:

> The function completion--replace mutates the replacement string, it
> strips the text properties.

I don't think that's, strictly speaking, illegal.  :-)

Anyway, I agree that it's unfortunate that completion destructively
modifies the strings it's handed, and this has been discussed
extensively over the years (and there's probably several bug reports
open about that, although I can't find them now).

I don't remember why we're doing that, but I seem to vaguely recall that
there's a reason...  Anybody?

We should (at least) document this in all the relevant functions.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 12:18:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140743124562 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: mail@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140743124562
          (code B ref 55205); Sun, 01 May 2022 12:18:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 12:17:11 +0000
Received: from localhost ([127.0.0.1]:59804 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl8Vj-0006O5-K7
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 08:17:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35610)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nl8Vi-0006Nr-Gl
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 08:17:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36540)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl8Vc-0004y7-H5; Sun, 01 May 2022 08:17:04 -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=4QP3QMegZTIoEr8XiO9rlLQfY0nbXChC/b8P/9vJe40=; b=ZnW4Jdw4Mqhz
 S54OSBeutfH3QujXaTpFVy2Q/VxxodsNn+GIDpVdOTg05WwijVtfvJfHGtzxbA4QpVGqiAYF/+Iwy
 67Uny/17iL+ubYxdGW0IE6kmkCTfl4datm0pWOgQ9yNkH215IyhRV/P6VWwEWYVFJEaJv1vkiq7YZ
 bGnNb1QeZWugx3nuWUhtK7FcOveMEPxXU14kg8p+PGgTljKYs2OUOQChDZ01HVL1QW7UJC99wiXa8
 VLoMBEQrPiAbi0EmowD87aTnqbJ8s1EGdV8mCilpjjfJlxVi/XQWwjILJTzr9kWHDDb/OJW43pO4x
 +rccgaCsbp4ZTm0BVs+6IA==;
Received: from [87.69.77.57] (port=2761 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl8Vb-0008Vn-UO; Sun, 01 May 2022 08:17:04 -0400
Date: Sun, 01 May 2022 15:17:10 +0300
Message-Id: <835ymp78hl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87wnf5mpt4.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sun, 
 01 May 2022 13:53:59 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
> Resent-CC: bug-gnu-emacs@HIDDEN
> Resent-Sender: help-debbugs@HIDDEN
> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Sun, 01 May 2022 13:53:59 +0200
> Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
> 
> Daniel Mendler <mail@HIDDEN> writes:
> 
> > The function completion--replace mutates the replacement string, it
> > strips the text properties.
> 
> I don't think that's, strictly speaking, illegal.  :-)
> 
> Anyway, I agree that it's unfortunate that completion destructively
> modifies the strings it's handed, and this has been discussed
> extensively over the years (and there's probably several bug reports
> open about that, although I can't find them now).
> 
> I don't remember why we're doing that, but I seem to vaguely recall that
> there's a reason...  Anybody?

I don't understand how can completion work in general without
destructively modifying strings.  Isn't that obvious?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 12:42:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140887026856 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140887026856
          (code B ref 55205); Sun, 01 May 2022 12:42:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 12:41:10 +0000
Received: from localhost ([127.0.0.1]:59832 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl8sw-0006z6-34
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 08:41:10 -0400
Received: from server.qxqx.de ([178.63.65.180]:50151 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl8sq-0006yI-IA
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 08:41:08 -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=L7miUtja1fLQoSxtFWpVHcZHeW4hQqrS3NXFSHeC4WA=; b=V0wBOUkFKvtSgCeKzvE0TqA/M+
 bXZaSUfxk9ZDHFueed7k82K50z3ZMAXft9kcIv5I+QDGo0hU06t3LQy1606qGZDdaJlJgfPIMQT9j
 bw3zcs0ILc1E5adH806TMNJ75kaH3ij8UICNBfLaTFRJi4iu6zVt/0vNgmXj0JUqrFLw=;
Message-ID: <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
Date: Sun, 1 May 2022 14:40:54 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87wnf5mpt4.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/1/22 13:53, Lars Ingebrigtsen wrote:
> Anyway, I agree that it's unfortunate that completion destructively
> modifies the strings it's handed, and this has been discussed
> extensively over the years (and there's probably several bug reports
> open about that, although I can't find them now).
> 
> I don't remember why we're doing that, but I seem to vaguely recall that
> there's a reason...  Anybody?
> 
> We should (at least) document this in all the relevant functions.

No, documenting this is not sufficient. I agree that mutating is not
strictly speaking illegal as a side effect of completion--replace, but
unfortunate and bad API design.

But the bug report here is about an actual bug in
minibuffer-force-complete which relies on completion--replace. As a
consequence  completion candidate strings are *illegally mutated*. I
propose to fix such issues once and for all by removing the unfortunate
mutation in completion--replace.

A while ago I discussed about this with Stefan. I hope he can give more
background regarding the reasons for the current behavior.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 12:50:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140937227766 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140937227766
          (code B ref 55205); Sun, 01 May 2022 12:50:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 12:49:32 +0000
Received: from localhost ([127.0.0.1]:59842 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl912-0007Dl-2l
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 08:49:32 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38726)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nl911-0007Da-49
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 08:49:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37004)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl90u-0001Pw-Kd; Sun, 01 May 2022 08:49:24 -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=r+Qn7xW7I4G38LsEhnVmFjaG89gCLF52NaR4bCYQoy0=; b=c96OsaGD46Cl
 81CsBFvsnrxEtW3gHwqK4M9OPqEqLgKcEoZLOyNNf5jS6NL2S2JtbRhIwW6rj5oYbuWfj3fayxTSM
 DSFR7U9by72qWlmBcajPVoeG4KHQBdVbLMFPnLcqmZAtsDNLphWHcI3TMcfbtsqrGIQ1oBUtTDXQq
 MOVMmiQuzJg88ZbSiKszVirp3t6CgCIITxkM3aAm9ZnH1E1slyFgHbFd1u2qTK6q+Y65JG25NXNYZ
 I9gy/jWmgZdJlz8vbKVyySMVkNG0sx7OqCs/QwxePtVhNzNB7yvlfyE3xNGua0lHZV3i3YLqD1Wz8
 w5C75TCuF/YHONIXj6gW4w==;
Received: from [87.69.77.57] (port=4760 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl90u-0005ah-4e; Sun, 01 May 2022 08:49:24 -0400
Date: Sun, 01 May 2022 15:49:30 +0300
Message-Id: <8335ht76zp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN> (message
 from Daniel Mendler on Sun, 1 May 2022 14:40:54 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Sun, 1 May 2022 14:40:54 +0200
> From: Daniel Mendler <mail@HIDDEN>
> Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
> 
> No, documenting this is not sufficient. I agree that mutating is not
> strictly speaking illegal as a side effect of completion--replace, but
> unfortunate and bad API design.
> 
> But the bug report here is about an actual bug in
> minibuffer-force-complete which relies on completion--replace. As a
> consequence  completion candidate strings are *illegally mutated*. I
> propose to fix such issues once and for all by removing the unfortunate
> mutation in completion--replace.

As an aside, please don't use "illegal" unless you mean something that
is against the law.  GNU Coding Standards frown on using "illegal" for
something that is merely incorrect or invalid coding practices.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 12:51:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140945527909 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140945527909
          (code B ref 55205); Sun, 01 May 2022 12:51:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 12:50:55 +0000
Received: from localhost ([127.0.0.1]:59846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl92N-0007G5-Dn
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 08:50:55 -0400
Received: from server.qxqx.de ([178.63.65.180]:51587 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl92M-0007Fs-BK
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 08:50:54 -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:
 References:Cc:To:From: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=Nkf9yTjS0lU52oO8M8dzZ976KryvjvpDewWKeDGOSz0=; b=vIkYTrNE3Fw7DoDrtj+U7rplts
 92VRLnpC0mfnzi66Z/ScGMNT2ZHPW6OqdR2wC8QEqYn8QkY1ySYEzdzOeLelDlt5YNbZ59D879Pcv
 +SZGb1XR/5PhFYuyhAJHhHsDlFy5JyGBciImiMhvlogFrXcNKVkbY/Dgcu/ZhUDlXMDI=;
Message-ID: <aead306c-4207-a78d-970a-b732b8906c7c@HIDDEN>
Date: Sun, 1 May 2022 14:50:45 +0200
MIME-Version: 1.0
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
In-Reply-To: <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 (---)

Here is a short recipe you can try with emacs -Q.

;; 1. Turn on fido
(fido-vertical-mode)

;; 2. Define some candidates with text properties
(defvar candidates
  (list (propertize "Emacs" 'face 'success)
        (propertize "Vim" 'face 'error)))

;; 3. Run completing-read and RET immediately (select Emacs)
;; RET invokes icomplete-fido-ret
;; -> icomplete-force-complete-and-exit
;; -> minibuffer-force-complete-and-exit
;; -> completion--complete-and-exit
;; -> completion--replace (the mutation happens there)
(completing-read "Make your choice: " candidates)

;; 4. Inspect the candidates, face of the selected candidate is lost
candidates




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 12:56:02 +0000
Resent-Message-ID: <handler.55205.B55205.165140970628285 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165140970628285
          (code B ref 55205); Sun, 01 May 2022 12:56:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 12:55:06 +0000
Received: from localhost ([127.0.0.1]:59850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl96P-0007M9-UB
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 08:55:06 -0400
Received: from server.qxqx.de ([178.63.65.180]:43945 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl96O-0007Lh-L3
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 08:55:05 -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=4Vkcl/qc5vHaDtS3+mRm8lgv8vapeWftCBcPtHME1+E=; b=Q2wZB6ByUmA/rp8KRLAyJ7HBOV
 6hI4JNmMoyjaAM8XjxFLNrnWCuSZaaKrOAPqaNG4/GLHZyisRt8O8mmUEYYg8ggLNjF93vzJ0ZsxF
 SMG1RAHyf8UpE906Z7t0c3b4BFtvD/QOeABKQohilwZnbxp2dnmrkJiGh9HPOMxodD3E=;
Message-ID: <92d33ed7-8274-ad54-a926-62d31f2dee38@HIDDEN>
Date: Sun, 1 May 2022 14:54:56 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
 <8335ht76zp.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <8335ht76zp.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 (---)

> As an aside, please don't use "illegal" unless you mean something that
> is against the law.  GNU Coding Standards frown on using "illegal" for
> something that is merely incorrect or invalid coding practices.

Good to know.

[[However I'd say that the word "illegal" is used precisely right here.
If we talk about "illegal memory access" we talk about memory being
accessed against the rules or ownership of the memory region. In this
case a string is mutated by completing-read, but ownership of the string
in question is not passed to completing-read.]]




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 13:17:02 +0000
Resent-Message-ID: <handler.55205.B55205.165141097330252 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165141097330252
          (code B ref 55205); Sun, 01 May 2022 13:17:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 13:16:13 +0000
Received: from localhost ([127.0.0.1]:59868 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl9Qr-0007rs-3y
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 09:16:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41252)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nl9Qp-0007rd-50
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 09:16:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:37320)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl9Qi-0005DS-9r; Sun, 01 May 2022 09:16:04 -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=gp8Gpt+hywl5pzsXrNY7ZlvfNtSj4+RwAW0QkERaqYc=; b=onjspc/fEmF5
 ABKbjX5hCKt1IXtW2thrSE9ZTnY3Pdvlwz0eCj+Ge+SkHJ6OIM2bNy1rKItx+c1/pMlwIRQzoxuRx
 i+0iMJePZ7D12otTlTjV1mXueIr5KAZPLrRMRnswpVn8XNTOveP7//1h8b6C/mleWA9SgKSYx7xPU
 xnPkZdXQMyZrV7tajPyv8V41kcxiBpKIixHtUzgV0ts+Q1le2Ygi6Yi2eM45wPtXLFzLw1goPRzdF
 1OBXxvbERTii9kN5X0H9cG7snQ8gr6kXCWfULycSeokquV5V6eCnktfZmgy1Mr7wrpZ7R+avdhe87
 F2sFuEBhNEnuwUgYFCC1SA==;
Received: from [87.69.77.57] (port=2511 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nl9Qh-0007KX-PF; Sun, 01 May 2022 09:16:04 -0400
Date: Sun, 01 May 2022 16:16:09 +0300
Message-Id: <831qxd75ra.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <92d33ed7-8274-ad54-a926-62d31f2dee38@HIDDEN> (message
 from Daniel Mendler on Sun, 1 May 2022 14:54:56 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
 <8335ht76zp.fsf@HIDDEN>
 <92d33ed7-8274-ad54-a926-62d31f2dee38@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Sun, 1 May 2022 14:54:56 +0200
> Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
> From: Daniel Mendler <mail@HIDDEN>
> 
> > As an aside, please don't use "illegal" unless you mean something that
> > is against the law.  GNU Coding Standards frown on using "illegal" for
> > something that is merely incorrect or invalid coding practices.
> 
> Good to know.
> 
> [[However I'd say that the word "illegal" is used precisely right here.
> If we talk about "illegal memory access" we talk about memory being
> accessed against the rules or ownership of the memory region.

In the GNU Project, we say "invalid memory access".




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 13:20:03 +0000
Resent-Message-ID: <handler.55205.B55205.165141119430613 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165141119430613
          (code B ref 55205); Sun, 01 May 2022 13:20:03 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 13:19:54 +0000
Received: from localhost ([127.0.0.1]:59885 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl9UQ-0007xh-Iw
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 09:19:54 -0400
Received: from server.qxqx.de ([178.63.65.180]:43993 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl9UP-0007xT-Fh
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 09:19:54 -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=6cvEz87tlqpinFDR3GaMtQN+2FiKALXTW3u+QDeegxs=; b=ff++thMZ4oC/PqupAejqZ72mRu
 26QMsxRWVihFhx4+c5T6jvtv20OOWAq9EmJNZOmvVurUU0bqZvBxPepTD8jlLabSfTU7yW3QicYnE
 czHf8wMG0tOp4Ccu/YhaZYYXUhr+s8GdezdQVMwpCQw/tKv6geEGtqQMd/oUWvwyUDb0=;
Message-ID: <dc60d09b-d31b-3dd8-43ec-fc22461648ec@HIDDEN>
Date: Sun, 1 May 2022 15:19:46 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
 <8335ht76zp.fsf@HIDDEN>
 <92d33ed7-8274-ad54-a926-62d31f2dee38@HIDDEN>
 <831qxd75ra.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <831qxd75ra.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/1/22 15:16, Eli Zaretskii wrote:
>> Date: Sun, 1 May 2022 14:54:56 +0200
>> Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
>> From: Daniel Mendler <mail@HIDDEN>
>>
>>> As an aside, please don't use "illegal" unless you mean something that
>>> is against the law.  GNU Coding Standards frown on using "illegal" for
>>> something that is merely incorrect or invalid coding practices.
>>
>> Good to know.
>>
>> [[However I'd say that the word "illegal" is used precisely right here.
>> If we talk about "illegal memory access" we talk about memory being
>> accessed against the rules or ownership of the memory region.
> 
> In the GNU Project, we say "invalid memory access".

Good. I like the GNU Newspeak. :)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 13:22:02 +0000
Resent-Message-ID: <handler.55205.B55205.165141128630815 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165141128630815
          (code B ref 55205); Sun, 01 May 2022 13:22:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 13:21:26 +0000
Received: from localhost ([127.0.0.1]:59893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nl9Vu-00080w-Be
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 09:21:26 -0400
Received: from server.qxqx.de ([178.63.65.180]:36093 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nl9Vt-00080l-4n
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 09:21: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:
 References:Cc:To:From: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=JdhqVi0IalFmiLFSz9MbMnW2j8VLqzEmB33VDf3Y9LI=; b=wLgpl1ic3QX22eYMctUPOv7G4D
 c/MNWhp+nV5PLZ9cCV1nkkqs0s5g2tcZby9G5ysnGH1AL65RmBdWgiDU/MIjziC99E72bkvKcsxme
 KC2Jo4b8uw4JHiZbUrOQXWNxCNSM69esoZKrI0GI5AzIHwQnA4xn4veQABUuGzR+Y2Zg=;
Message-ID: <7452b291-abf2-dd8e-219b-a9d2932a2454@HIDDEN>
Date: Sun, 1 May 2022 15:21:18 +0200
MIME-Version: 1.0
Content-Language: en-US
From: Daniel Mendler <mail@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
 <4c66528e-5d99-719f-6d40-dcf604849200@HIDDEN>
 <8335ht76zp.fsf@HIDDEN>
 <92d33ed7-8274-ad54-a926-62d31f2dee38@HIDDEN>
 <831qxd75ra.fsf@HIDDEN>
 <dc60d09b-d31b-3dd8-43ec-fc22461648ec@HIDDEN>
In-Reply-To: <dc60d09b-d31b-3dd8-43ec-fc22461648ec@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/1/22 15:19, Daniel Mendler wrote:
> Good. I like the GNU Newspeak. :)

Sorry, I meant GNUSpeak or is it with a slash?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 17:08:02 +0000
Resent-Message-ID: <handler.55205.B55205.165142486230505 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165142486230505
          (code B ref 55205); Sun, 01 May 2022 17:08:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 17:07:42 +0000
Received: from localhost ([127.0.0.1]:34074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlD2s-0007vx-By
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 13:07:42 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16296)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlD2q-0007vk-Nj
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 13:07:41 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2EC9A80009;
 Sun,  1 May 2022 13:07:35 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CF8D680539;
 Sun,  1 May 2022 13:07:33 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651424853;
 bh=gCvuCiBXRDDMWwJhT462ZTH4Nf25Bh9rrN3xYbnr26w=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=Z6g1zu/1W/d9LRwjGrIBdxhQZnQDTd9332+RdGuPeCggRkVzzXJXvxqqvPdP08EjV
 VsFAX7J3cBvA/fr+vaX2HbePBRt5NaTE1vLqQnQqCC0AaRlZPxNVheUbxWIZnUGEzG
 kpdUTsxkwdwnCSF+S9UsErwfMlEDsyPgCouz6q8QTwXioxnEbYS03JA9aMKLudAsxw
 /Zx1Fywk6XvI7Es78bPOHl5Wy6f3kxsuULeFRKbVCYAey9bha5tC4RTpf2j8l8YDcl
 T1gI6j9XgywGIE6TZApEHYPZymOxS7Muzb03xscL0lxCSXUYeg1ciUmRHnvbdGGY3C
 1XO0mq4X2kpcw==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8D7701204BD;
 Sun,  1 May 2022 13:07:33 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
Date: Sun, 01 May 2022 13:07:31 -0400
In-Reply-To: <87wnf5mpt4.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 01 May 2022 13:53:59 +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.056 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-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 (---)

Lars Ingebrigtsen [2022-05-01 13:53:59] wrote:
> Daniel Mendler <mail@HIDDEN> writes:
>> The function completion--replace mutates the replacement string, it
>> strips the text properties.
> I don't think that's, strictly speaking, illegal.  :-)

[ Notice the smiley.  ]

> Anyway, I agree that it's unfortunate that completion destructively
> modifies the strings it's handed, and this has been discussed
> extensively over the years (and there's probably several bug reports
> open about that, although I can't find them now).
>
> I don't remember why we're doing that, but I seem to vaguely recall that
> there's a reason...  Anybody?

I'm pretty sure there's a reason, and I'm pretty sure this reason is
"sloppiness".  I blame the author of commit 1d00653d9e (and the author
of commit 14486c44 might be considered as an accessory to the crime).

> We should (at least) document this in all the relevant functions.

I think it's much better to fix the bug, so I just pushed the patch
below to `master`.

I think it's safe enough for `emacs-28`, but I can't claim it's
"obviously safe", the way I could about that same `copy-sequence` in
`cl-generic.el`.


        Stefan


commit 788694d026b401715330576633a98542623978ff (HEAD -> main, origin/master, origin/HEAD)
Author: Stefan Monnier <monnier@HIDDEN>
Date:   Sun May 1 13:04:44 2022 -0400

    * lisp/minibuffer.el (completion--replace): Fix bug#55205

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index ef71b4e6be6..fb473cf71b0 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1140,6 +1140,7 @@ completion--replace
   ;; The properties on `newtext' include things like the
   ;; `completions-first-difference' face, which we don't want to
   ;; include upon insertion.
+  (setq newtext (copy-sequence newtext)) ;Don't modify the arg by side-effect.
   (if minibuffer-allow-text-properties
       ;; If we're preserving properties, then just remove the faces
       ;; and other properties added by the completion machinery.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 17:28:01 +0000
Resent-Message-ID: <handler.55205.B55205.165142603232235 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165142603232235
          (code B ref 55205); Sun, 01 May 2022 17:28:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 17:27:12 +0000
Received: from localhost ([127.0.0.1]:34090 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlDLk-0008Nq-Cs
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 13:27:12 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33072)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlDLj-0008Nb-40
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 13:27:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=20/fYgYzPBG2gWvRwpjEqv1qi7j5UX9Sc65T2fMktss=; b=JCoD7GmwUtcpx1RgnnWjqRXzE7
 SLPtSBpeD8Aaue0GEitz52DHZHQll21gH2QRNPFrTy7JmqA8Phryto8sLyynE5WM6swJao5Z+erW6
 vgx59rVE0P0FzBq0wCcL1WAZ6r3h0zDiG8+wci2PN7d7ldJNedNV5LNaHZhD5eKUZRgA=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlDLZ-0007xE-2c; Sun, 01 May 2022 19:27:03 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXSysehgW0/OEH/
 //+dT5xyAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YFAREaCjGJYKgAAAFrSURBVCjPTdHBSsNAEAbg
 2UAL5uTBXvIG9ilSqT2n0Am6Jw8idp5CwQdooS3Yk4ckZP+n9J8kgpvLfszM7uxEgj7LnXDtA4Qo
 fS/9CAnOXkzC6nkIzOxsIqsxLTdA5JER8n7CENnD4adVIskj1XaIhP/I0pBWEeX7vAUSa2IpoZ93
 QPeH/NtwFdkSD33+tIRJOUXeLYGoeRpuWj96p3V1m+FzuEc1biVHl5BM5hqPZYEWHlns8SpL9Cgc
 ipMYgaHGWsG4CLTBd5cRKeO+mTkMaUN8sJAR3kSsJ8SheAJb9Ic5NmoN0LNZIm+tMTQSHLG1FdKr
 ZA6cbYP+ReaOpPboyH1u9xpP6Ct2Drm1CX7XClofkQ7eH08kLB0Kx+yq9QmHbmgpj7t8YYexv5sY
 4gJpiTdP0zptOaZWa0jWsW8O6metxOWsyjecg9aSfSkTCNWLhLUsalz5+WsLvpsjGf8p/13RFIYJ
 nENKSvwCpMHej2mpf9MAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDUtMDFUMTc6MjY6MDkrMDA6
 MDCSuNgiAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA1LTAxVDE3OjI2OjA5KzAwOjAw4+VgngAA
 AABJRU5ErkJggg==
X-Now-Playing: Arto Lindsay, Joe McPhee, Ken Vandermark, and Phil
 Sudderberg's _Largest Afternoon_: "So What's Your Idea Of Epic"
Date: Sun, 01 May 2022 19:26:58 +0200
In-Reply-To: <jwv7d75chrf.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sun, 01 May 2022 13:07:31 -0400")
Message-ID: <87k0b5duzh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Stefan Monnier <monnier@HIDDEN> writes: >> I don't
 remember why we're doing that, but I seem to vaguely recall that >> there's
 a reason... Anybody? > > I'm pretty sure there's a reason, and I'm pretty
 sure this reason is > "sloppiness". I b [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> I don't remember why we're doing that, but I seem to vaguely recall that
>> there's a reason...  Anybody?
>
> I'm pretty sure there's a reason, and I'm pretty sure this reason is
> "sloppiness".  I blame the author of commit 1d00653d9e (and the author
> of commit 14486c44 might be considered as an accessory to the crime).

Is there no way to let the text properties survive completion?  Because
that's also come up more than a few times.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 17:37:01 +0000
Resent-Message-ID: <handler.55205.B55205.1651426584649 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.1651426584649
          (code B ref 55205); Sun, 01 May 2022 17:37:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 17:36:24 +0000
Received: from localhost ([127.0.0.1]:34095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlDUd-0000AN-9U
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 13:36:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42197)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlDUb-00009z-HG
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 13:36:22 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 86D7180699;
 Sun,  1 May 2022 13:36:15 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4A38780539;
 Sun,  1 May 2022 13:36:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651426574;
 bh=XQxzpQPTbxQ/nqN4vJRZ2NTEmVGTZfu6M/9OM9eki64=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=Rix/SPzqKVMkajC9X96JfF9/TvS0+Bm0VIiAor1GA2+NucaHqzOrK8ZrpQb1mXGtS
 ZhCbAfCoVUR+iizfxbTidGVOK5qQfJnX+BBSJa3+JVoPm2aAqldSGpYjOCZnm8hQMX
 uu0X6pv5A/0BLzozwZ7mMlfXEUoUsNdF+ugEPRZrHiVkYokh1uL7SDIKn0l13f3yja
 GuCTqPOXsvCnMXeg94uRjfx4jF31NeJoQfi81P6ssUoX/cWh7WOib/qUK55fXfMIHC
 TViLAMd9Ceeo2l0RfqXt3gP4/rrVGoUShGbMRX+k+vQfkA7pWdbl3bMY2NrzNVlll5
 Zdw01Tm4HYzJA==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1728F120744;
 Sun,  1 May 2022 13:36:14 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvpmkxb1ik.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
Date: Sun, 01 May 2022 13:36:11 -0400
In-Reply-To: <87k0b5duzh.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 01 May 2022 19:26:58 +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.056 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-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 (---)

Lars Ingebrigtsen [2022-05-01 19:26:58] wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
>>> I don't remember why we're doing that, but I seem to vaguely recall that
>>> there's a reason...  Anybody?
>>
>> I'm pretty sure there's a reason, and I'm pretty sure this reason is
>> "sloppiness".  I blame the author of commit 1d00653d9e (and the author
>> of commit 14486c44 might be considered as an accessory to the crime).
>
> Is there no way to let the text properties survive completion?  Because
> that's also come up more than a few times.

Not sure what you mean by that.
I suspect that the details depend a lot on where the completion string
comes from.  Already the current code's check for
`minibuffer-allow-text-properties` seems too coarse since it is used
even when the completion is inserted into a normal buffer.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 17:40:02 +0000
Resent-Message-ID: <handler.55205.B55205.1651426756909 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.1651426756909
          (code B ref 55205); Sun, 01 May 2022 17:40:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 17:39:16 +0000
Received: from localhost ([127.0.0.1]:34100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlDXQ-0000Ea-4j
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 13:39:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40006)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlDXN-0000EN-JY
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 13:39:14 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40638)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlDXH-0004Jz-16; Sun, 01 May 2022 13:39:07 -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=RUcb5Wo9gqVq1cM33sqCKXrhhuz+H5MrIwPj84dNodE=; b=Mh7aMaJwkjMo
 S/t7zIPxmMuwxyKyMmchealt8Qu/ig7Tns8s8pykbuUck0zFpXxwFg8sTawnxJ+eIg/tMU34RUjio
 ggjTR0l3N+Gt9jqp0G+gWzMB0j4+PyXO8VCM8gqcabxzXWPMwN1CMycLIPXcGBlZBIeCNfNUSO30M
 yvflUC2PuiOsCc47A12HVBtMC60XRXhDvhnJU0I0mIcFxJ1M1747OEJgHD5Weh+rxBjXhtIAcbcyq
 89ae7nXupq5KkiU7imEfV85Q6yHRph+wwJi6Ibiup6ag6iqm0nk2QAAwLVRTDaXjQayw1ScyytoVP
 CPoGi6q2r3Ax5plAiuqWAw==;
Received: from [87.69.77.57] (port=2873 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlDXG-0007X8-Dq; Sun, 01 May 2022 13:39:06 -0400
Date: Sun, 01 May 2022 20:39:12 +0300
Message-Id: <83fslt5f0f.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <jwv7d75chrf.fsf-monnier+emacs@HIDDEN> (bug-gnu-emacs@HIDDEN)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
> Date: Sun, 01 May 2022 13:07:31 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> I think it's safe enough for `emacs-28`, but I can't claim it's
> "obviously safe", the way I could about that same `copy-sequence` in
> `cl-generic.el`.

I can: it isn't.  Changes in the bowels of completion, in code that
worked like that for 10 years, safe for the release branch? really?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 17:49:04 +0000
Resent-Message-ID: <handler.55205.B55205.16514273101956 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16514273101956
          (code B ref 55205); Sun, 01 May 2022 17:49:04 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 17:48:30 +0000
Received: from localhost ([127.0.0.1]:34121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlDgM-0000VT-C4
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 13:48:30 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33352)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlDgK-0000VF-MW
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 13:48:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=Pblm+6iaMPe5cBz0HO33Glp1gox/kkKD+QniFzimzWA=; b=HssZUCRKSoCFaRpsKWVHed5mAR
 oTm1UWngiY/CnP7o+Q1WVfopKMrGzAQttef0ds9YE8PxS2MHHIv7pNODPgXZ4TORFJO1dDkM3zx7B
 snaL7y+U0MriT06fbar/OADvpRMRHsRiwgQ4tBg6rifQ+FiUWmejUtxmfezCb/F7X3Zo=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlDgA-000891-CL; Sun, 01 May 2022 19:48:20 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN> <jwvpmkxb1ik.fsf-monnier+emacs@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXSysehgW0/OEH/
 //+dT5xyAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YFAREaCjGJYKgAAAFrSURBVCjPTdHBSsNAEAbg
 2UAL5uTBXvIG9ilSqT2n0Am6Jw8idp5CwQdooS3Yk4ckZP+n9J8kgpvLfszM7uxEgj7LnXDtA4Qo
 fS/9CAnOXkzC6nkIzOxsIqsxLTdA5JER8n7CENnD4adVIskj1XaIhP/I0pBWEeX7vAUSa2IpoZ93
 QPeH/NtwFdkSD33+tIRJOUXeLYGoeRpuWj96p3V1m+FzuEc1biVHl5BM5hqPZYEWHlns8SpL9Cgc
 ipMYgaHGWsG4CLTBd5cRKeO+mTkMaUN8sJAR3kSsJ8SheAJb9Ic5NmoN0LNZIm+tMTQSHLG1FdKr
 ZA6cbYP+ReaOpPboyH1u9xpP6Ct2Drm1CX7XClofkQ7eH08kLB0Kx+yq9QmHbmgpj7t8YYexv5sY
 4gJpiTdP0zptOaZWa0jWsW8O6metxOWsyjecg9aSfSkTCNWLhLUsalz5+WsLvpsjGf8p/13RFIYJ
 nENKSvwCpMHej2mpf9MAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDUtMDFUMTc6MjY6MDkrMDA6
 MDCSuNgiAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA1LTAxVDE3OjI2OjA5KzAwOjAw4+VgngAA
 AABJRU5ErkJggg==
X-Now-Playing: Arto Lindsay, Joe McPhee, Ken Vandermark, and Phil
 Sudderberg's _Largest Afternoon_: "The World's Longest Afternoon"
Date: Sun, 01 May 2022 19:48:16 +0200
In-Reply-To: <jwvpmkxb1ik.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sun, 01 May 2022 13:36:11 -0400")
Message-ID: <87fsltdtzz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Stefan Monnier <monnier@HIDDEN> writes: >> Is there
 no way to let the text properties survive completion? Because >> that's also
 come up more than a few times. > > Not sure what you mean by that. > I suspect
 that the details depend a lot on [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> Is there no way to let the text properties survive completion?  Because
>> that's also come up more than a few times.
>
> Not sure what you mean by that.
> I suspect that the details depend a lot on where the completion string
> comes from.  Already the current code's check for
> `minibuffer-allow-text-properties` seems too coarse since it is used
> even when the completion is inserted into a normal buffer.

I mean -- don't alter any of the strings the completion machinery is
fed, but return them as is.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 18:08:02 +0000
Resent-Message-ID: <handler.55205.B55205.165142842312122 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165142842312122
          (code B ref 55205); Sun, 01 May 2022 18:08:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 18:07:03 +0000
Received: from localhost ([127.0.0.1]:34145 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlDyJ-00039S-JO
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 14:07:03 -0400
Received: from server.qxqx.de ([178.63.65.180]:41897 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlDyH-00038x-MP
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 14:07:02 -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=kjnncOa27K5VjWdhzCFdxEqx8YfvEj4spfpbMCIT10g=; b=hEMQpjJlZYyBsW/xFgZFOvtepd
 srFUPu+lFnvETQnsBID0Y73kakS2ulZV5DMNKfp5eNrrJbcX2flhiLbRK93IEBvaNhMrE3Jc1m00k
 MSmhYhz5cJgj41x84E5kHG0v81X6KEa7VLYNL9vy3UM1f6eSqW8U9ygOIyE7oL++FPJA=;
Message-ID: <80d87c54-8964-8440-8327-e0e0ae9c56f2@HIDDEN>
Date: Sun, 1 May 2022 20:06:52 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 (---)

> I think it's much better to fix the bug, so I just pushed the patch
> below to `master`.
> 
> I think it's safe enough for `emacs-28`, but I can't claim it's
> "obviously safe", the way I could about that same `copy-sequence` in
> `cl-generic.el`.
>
> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index ef71b4e6be6..fb473cf71b0 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -1140,6 +1140,7 @@ completion--replace
>    ;; The properties on `newtext' include things like the
>    ;; `completions-first-difference' face, which we don't want to
>    ;; include upon insertion.
> +  (setq newtext (copy-sequence newtext)) ;Don't modify the arg by side-effect.
>    (if minibuffer-allow-text-properties
>        ;; If we're preserving properties, then just remove the faces
>        ;; and other properties added by the completion machinery.

Thanks, Stefan! This is the proper fix. I also think this is safe enough
for the emacs-28 branch. It will also fix the icomplete bug there, where
minibuffer-force-complete *incorrectly* strips the text properties.

Daniel





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 18:28:01 +0000
Resent-Message-ID: <handler.55205.B55205.165142967214009 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165142967214009
          (code B ref 55205); Sun, 01 May 2022 18:28:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 18:27:52 +0000
Received: from localhost ([127.0.0.1]:34162 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlEIS-0003dt-7w
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 14:27:52 -0400
Received: from server.qxqx.de ([178.63.65.180]:36695 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlEIQ-0003dg-DV
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 14:27:50 -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=8l8Wl3gj4DTsTAwSMUx5UDZgUMw0vBC0wK6LJpM4e9I=; b=fit9L57rFOWrxV2uw2pw3LXNYO
 sxcSdoZHHkB7A3YTKaQHTO3347/4thvMdERLTV4AAv9IJmv85j6K6AHMq0kYiF3A2lJ7x/YnQHTPG
 W77qXrYiazU4FOP2mSH9iPM0rD4DIFULyGSXVgkRT864hA0877L5qjV+CfJlRDOtI32U=;
Message-ID: <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
Date: Sun, 1 May 2022 20:27:41 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87k0b5duzh.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/1/22 19:26, Lars Ingebrigtsen wrote:
>>> I don't remember why we're doing that, but I seem to vaguely recall that
>>> there's a reason...  Anybody?
>>
>> I'm pretty sure there's a reason, and I'm pretty sure this reason is
>> "sloppiness".  I blame the author of commit 1d00653d9e (and the author
>> of commit 14486c44 might be considered as an accessory to the crime).
> 
> Is there no way to let the text properties survive completion?  Because
> that's also come up more than a few times.

Just to clarify, the question if completion should preserve candidate
text properties is a different one than the one which led to this bug
report. There is minibuffer-allow-text-properties as Stefan pointed out.
This lets completion UIs preserve text properties in principle when
returning from the minibuffer.

However when completing a string in the minibuffer, the completed string
can also be typed by the user and as such won't have the text properties
attached in the first place. The completion UI would then have to lookup
the input string in the list of propertized candidate strings. Of course
this makes only sense for REQUIRE-MATCH non-nil.

One motivation for text property preservation is the disambiguation of
equal strings. I argue that equal candidate strings are not a good idea
since the user has no way to distinguish them TAB completing. However
disambiguation (and preserving object identity) would be possible in
completion UIs with a selection mechanism (clicking in the Completions
buffer, or selecting a marked candidate in Icomplete/Vertico/Ivy/...).
It boils down to the question if we treat completion as step-by-step
text completion (by pressing TAB) or as a selection process of a
candidate. Due to the way these different UIs behave, selection vs
completion is a gray zone.

About a year ago I was also in the camp of people who wanted to preserve
text properties (because of disambiguation, to be able to attach
metadata and because object identity). I asked once one the mailing list
about this. But I've changed my opinion since then. Not preserving text
properties for completion seems like the better approach since then we
make fewer assumptions how the candidate materializes, either via
selection, via manual input or via TAB-completion. For unique candidate
strings and REQUIRE-MATCH non-nil, looking up metadata in a hash table
or an alist after the return of completing-read is only a small
inconvenience.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 18:35:02 +0000
Resent-Message-ID: <handler.55205.B55205.165143009014721 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165143009014721
          (code B ref 55205); Sun, 01 May 2022 18:35:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 18:34:50 +0000
Received: from localhost ([127.0.0.1]:34175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlEPB-0003pM-MV
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 14:34:49 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47671)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlEP9-0003p7-EM
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 14:34:47 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A1DF9100280;
 Sun,  1 May 2022 14:34:41 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F24541000C4;
 Sun,  1 May 2022 14:34:35 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651430075;
 bh=aZ7dRxotARB5Frx9G8+yGC/YqSU5HY6RS/rLfi4/o7Q=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=B81zLXWri63QmIQoK+8tgRbJpwChCyLqoaO6EihiJni1uLuJbb4wcvWvnTVTj6rj9
 HFtcp4wdyG+A0ARoz0oLGUhjQLuxaJW7x7DxOj/dsIW9/aQvVcPzuuYzN2kGRH6jMj
 rZ3wITJd4fa6Lln43AsMhfmCQisvGPPB8N7TkNCjuT5cUEfP6K4pv8/BpwJFYXSBMJ
 BsutU9jyLnNmLPiNB4NXmM9jT4Qz5YjAtJOHVVm0/DstGeh0naUWOg+C6Lfj58Fv3p
 c1AjMVwnyq1TLEDNNFhpDL9O0KecTfjcu2Iy2B66HF1znHryzQoai/fPPWJIYo1NB/
 cOqthqYhpLOwA==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BF356120263;
 Sun,  1 May 2022 14:34:35 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvk0b5ayu1.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN> <jwvpmkxb1ik.fsf-monnier+emacs@HIDDEN>
 <87fsltdtzz.fsf@HIDDEN>
Date: Sun, 01 May 2022 14:34:34 -0400
In-Reply-To: <87fsltdtzz.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 01 May 2022 19:48:16 +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.044 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-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 (---)

Lars Ingebrigtsen [2022-05-01 19:48:16] wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
>>> Is there no way to let the text properties survive completion?  Because
>>> that's also come up more than a few times.
>> Not sure what you mean by that.
>> I suspect that the details depend a lot on where the completion string
>> comes from.  Already the current code's check for
>> `minibuffer-allow-text-properties` seems too coarse since it is used
>> even when the completion is inserted into a normal buffer.
> I mean -- don't alter any of the strings the completion machinery is
> fed, but return them as is.

`completion-replace` doesn't return anything, it just inserts the
string, and as the comment explains, in a common use case that string it
receives includes things like the `completion-first` face which is out
of place at the destination, so there's clearly a need to remove some
properties sometimes.  How best to do that of course depends on which
other properties we might want to keep and when.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 18:40:02 +0000
Resent-Message-ID: <handler.55205.B55205.165143037515182 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165143037515182
          (code B ref 55205); Sun, 01 May 2022 18:40:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 18:39:35 +0000
Received: from localhost ([127.0.0.1]:34183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlETn-0003wn-JC
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 14:39:35 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlETm-0003wY-S8
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 14:39:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=9lgyMhpAiHdX7V7nDQhhmv1lr3S9f5RqtDkYjIWIvjk=; b=XB+yMw+cDWdQkX39ZmZgrMQ7WS
 voq3u9Yrl+e8lLZ3izHG/p+vvRMIc0XrQ6rA9pzSN7ClwpM+OGSAVYrQFDZag3cL/0fOhiN3+qubA
 mn57WwDr3wuVNbM9HK0rmHp9y2nsljluUjKFpugZBccZg2ijBE+MQyXkVOnUNtCkezsY=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlETb-0000BC-KX; Sun, 01 May 2022 20:39:25 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAAAXNSR0IArs4c6QAAAAlQTFRF
 NjEurZ+U////zOWjqgAAAAFiS0dEAmYLfGQAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfm
 BQESFTabOL65AAAAuklEQVQoz3WQSw7EIAiGIZE9k7T3YZK610Tvf5UB1Mq86KZf/wdWAICz+xSw
 6QFwKuIwlRaV9p3pIUO/2gYMCT2P2d4rwC6o7CChbO4ZK98h/VXgEcGkLAt007Wh3mvcVyACTRTN
 CBroyQVWBIdtQbLqMoHtFsq2UQTMu4Cu0Ea9btvZRdKtNGFagI1HkU/WxaIxk0meekIZNtYHygS9
 Lr2W/a/aL+yZJe7BT7g/EAdI0XiESDpKLBB6AZJ2PakqBaeNAAAAJXRFWHRkYXRlOmNyZWF0ZQAy
 MDIyLTA1LTAxVDE4OjIxOjU0KzAwOjAwfiN5ygAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNS0w
 MVQxODoyMTo1NCswMDowMA9+wXYAAAA4dEVYdGljYzpjb3B5cmlnaHQAQ29weXJpZ2h0IChjKSAx
 OTk4IEhld2xldHQtUGFja2FyZCBDb21wYW55+Vd5NwAAACF0RVh0aWNjOmRlc2NyaXB0aW9uAHNS
 R0IgSUVDNjE5NjYtMi4xV63aRwAAACZ0RVh0aWNjOm1hbnVmYWN0dXJlcgBJRUMgaHR0cDovL3d3
 dy5pZWMuY2gcfwBMAAAAN3RFWHRpY2M6bW9kZWwASUVDIDYxOTY2LTIuMSBEZWZhdWx0IFJHQiBj
 b2xvdXIgc3BhY2UgLSBzUkdCRFNIqQAAAABJRU5ErkJggg==
X-Now-Playing: Let's Eat Grandma's _Two Ribbons_: "Insect Loop"
Date: Sun, 01 May 2022 20:39:22 +0200
In-Reply-To: <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN> (Daniel
 Mendler's message of "Sun, 1 May 2022 20:27:41 +0200")
Message-ID: <8735htdrmt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Daniel Mendler <mail@HIDDEN> writes: > However
 when completing a string in the minibuffer, the completed string > can also
 be typed by the user and as such won't have the text properties > attached
 in the first place. The completion UI w [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Daniel Mendler <mail@HIDDEN> writes:

> However when completing a string in the minibuffer, the completed string
> can also be typed by the user and as such won't have the text properties
> attached in the first place. The completion UI would then have to lookup
> the input string in the list of propertized candidate strings. Of course
> this makes only sense for REQUIRE-MATCH non-nil.

Ah, yes, I was thinking about the REQUIRE-MATCH case.

> One motivation for text property preservation is the disambiguation of
> equal strings. I argue that equal candidate strings are not a good idea
> since the user has no way to distinguish them TAB completing.

I've got an imdb interface where I choose among different movies (some
with the same name) by putting the movie poster in the completion
string to disambiguate.  That's the first place I ran into the problem,
years ago (and it seems like people keep trying to do things like that,
and then giving up).

If I remember correctly, I ended up copying most of the completion
machinery into the package just to avoid the stripping.

(It's a somewhat marginal problem, since it's seldom there's several
movies with the same name in the same year, but it happens.  But you
could imagine the same issue when completing, say, names in an org, and
displaying pics of the people to disambiguate.)

> It boils down to the question if we treat completion as step-by-step
> text completion (by pressing TAB) or as a selection process of a
> candidate. Due to the way these different UIs behave, selection vs
> completion is a gray zone.

Hm, yes.

> For unique candidate strings and REQUIRE-MATCH non-nil, looking up
> metadata in a hash table or an alist after the return of
> completing-read is only a small inconvenience.

Yes, but if the strings are identical (except for the text properties),
then that's not really an option.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 19:03:01 +0000
Resent-Message-ID: <handler.55205.B55205.1651431729562 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.1651431729562
          (code B ref 55205); Sun, 01 May 2022 19:03:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 19:02:09 +0000
Received: from localhost ([127.0.0.1]:34245 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlEpc-00008m-RL
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 15:02:09 -0400
Received: from server.qxqx.de ([178.63.65.180]:33381 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlEpa-0008U3-4v
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 15:02:07 -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=XXbl9zF0TrpgXRqZhgk8kNs0YeDIkf6vaeNnwoj3q2Q=; b=IKeOJjRQyj1ygYpYpowkf3yQo1
 4uk2ezoddlgnMKo9vEg7JM5M/kLIJi+y+r72OtBlUCKH1lPH9SMx03ESHHjmzNrV+qTYVfBIYfh5u
 5FDfTTGTOOgq3W/hhzEdFpHUuY7QTaP8gaLaa3JkeHiwqX7o+3yCv32BBzpIFvoEdEHs=;
Message-ID: <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
Date: Sun, 1 May 2022 21:01:57 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <8735htdrmt.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/1/22 20:39, Lars Ingebrigtsen wrote:
> Yes, but if the strings are identical (except for the text properties),
> then that's not really an option.

Yes. Just disambiguate the candidate strings. For example in the imdb
use case, you could append the year when the movie appeared. You could
only do this when two movies share the same name. This way the user can
distinguish the candidates by typing the year. The alternative you
mentioned to add an image as annotation (the movie poster), wouldn't
allow to complete the different candidates since the strings themselves
are equal. You would necessarily have to start a *selection process*,
e.g., by opening the Completions buffer or by rotating the candidate
list in Icomplete.

In my Consult package I had similar disambiguation issues, e.g., the
Imenu Java backend produces duplicates for overloaded methods. One can
disambiguate them by appending type information or by simply appending a
number. Another disambiguation issue occurs for Swiper/consult-line
which lets you complete lines in the buffer and jump to them. In this
case on can disambiguate by appending the line number.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 19:08:02 +0000
Resent-Message-ID: <handler.55205.B55205.16514320392487 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16514320392487
          (code B ref 55205); Sun, 01 May 2022 19:08:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 19:07:19 +0000
Received: from localhost ([127.0.0.1]:34249 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlEud-0000e3-KV
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 15:07:19 -0400
Received: from quimby.gnus.org ([95.216.78.240]:34240)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlEuc-0000dn-LO
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 15:07:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=1oP/EibAukEIAlsPb2HY18BXvlN1ydrjSe41regNGGE=; b=GZ3EhcVPNGnacuSNCaUWT/v23g
 B6aDuqBcwdGk6/dgueVBlg0Rd3hXb1iN1vGNt1o9LZd+iGMTyYzx+CjG2Zvu98rskR4dZ2Anvz/2u
 RpYkbUyYcJZtffVAYhEmUlQJtx4DdUpac0QZvKqmeBHMxtGFsVpuwgy0exdflpZF1z6s=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlEuS-0000SA-Fn; Sun, 01 May 2022 21:07:10 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
 <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
X-Now-Playing: Bogdan Raczynski's _Mixes_: "Mix 2"
Date: Sun, 01 May 2022 21:07:07 +0200
In-Reply-To: <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN> (Daniel
 Mendler's message of "Sun, 1 May 2022 21:01:57 +0200")
Message-ID: <87a6c1cbs4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Daniel Mendler <mail@HIDDEN> writes: > Yes. Just
 disambiguate the candidate strings. For example in the imdb > use case, you
 could append the year when the movie appeared. Like I said, there's sometimes
 several movies the same year with the same name. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Daniel Mendler <mail@HIDDEN> writes:

> Yes. Just disambiguate the candidate strings. For example in the imdb
> use case, you could append the year when the movie appeared.

Like I said, there's sometimes several movies the same year with the
same name.

> You would necessarily have to start a *selection process*,
> e.g., by opening the Completions buffer or by rotating the candidate
> list in Icomplete.

Yes, completion is impossible here, so the user has to select between
textually identical options.  But that's OK and an intuitive interface.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 20:12:01 +0000
Resent-Message-ID: <handler.55205.B55205.16514359078461 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Cc: mail@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16514359078461
          (code B ref 55205); Sun, 01 May 2022 20:12:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 20:11:47 +0000
Received: from localhost ([127.0.0.1]:34271 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlFv1-0002CP-3z
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 16:11:47 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:55838)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nlFuz-0002CC-7p
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 16:11:45 -0400
Received: by mail-wm1-f45.google.com with SMTP id m62so7318929wme.5
 for <55205 <at> debbugs.gnu.org>; Sun, 01 May 2022 13:11:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=E/spGP03N8cErA7qHhprcLQEEN54oJ6OQ5I5W9mMhAk=;
 b=evpdSIcHzo8AVEcf5LPMbJ3mUarfAni5t0PFkGjswRO4F1MsOC+fpdgfdD2/deVvO2
 rscnbpvP/Df2vbT8W1t3n/oZEdIfuJCAI1Kz/T5zrSXtKx2iG1u8SskkD7ePNbxOOTuV
 9F0hRFeeHYiBOWSdcIs9cNfshITq1zc+fniHBiqHhjvJm+rZXL1lhGLnkVAE6IsKOzvu
 I9U5WI7N/gwh2Lmz5CUBNnC+SrzoShnAjur6hnUkwtIC6ZGUTpX+yd7uzUCt8tl24u96
 ODcN1dSQ6wNXIz8DxwsOmLmBuCZrJJ8R7hQjUWCqMqYxFGehLV9mFkEtcbI84JKZgdLW
 1EpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=E/spGP03N8cErA7qHhprcLQEEN54oJ6OQ5I5W9mMhAk=;
 b=01vmvgQuwIzFPFUlV/OE7/H6AwPKqw89riLxjM53ht0p0bCAnF+HuEqSKie2N+ZDnG
 LyWulKXUIT9ixqhwbea12SDy58ppbb0ZG6l/2rPNUvecsL2WDu6y0arOmI/ctvng+R2O
 9J6ldlUK3+GYfnbht/odrA9jmofp4OyGizY/F7W1gmHN9j+NB462n0K7GyQTIxuu/XlI
 4QU3X79yP6YB+U2bJY6J9xiR9zMlNuD+YTzk9LgwTrPhXtUXHC+k/3mhOS+ax61+vO+M
 wd02gRBwb6suj9p2bTWMZBql2BeeJJA1U4SJYpAbOBk/zA4r1OsRVVFvXom2TIYWFbrG
 YfSw==
X-Gm-Message-State: AOAM5337RU5LW7JjJT2UTcHa3Hj6Hv1IbsQ1EnCcwWgXFyJ0Z1UFbxEc
 n6/os3Hk7UdEnS63V+hU+Tg=
X-Google-Smtp-Source: ABdhPJyF0vkL9KjtS26AdBypwQs5rGngyU+wP2z40Ubw2wH0cIDkSoFU9fPCxHSxFq2D8/AqChOUHA==
X-Received: by 2002:a05:600c:3d96:b0:38f:fbc6:da44 with SMTP id
 bi22-20020a05600c3d9600b0038ffbc6da44mr12566029wmb.93.1651435899202; 
 Sun, 01 May 2022 13:11:39 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 h29-20020adfaa9d000000b0020c5253d913sm5334825wrc.95.2022.05.01.13.11.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 01 May 2022 13:11:38 -0700 (PDT)
Message-ID: <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN>
Date: Sun, 1 May 2022 23:11:36 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <835ymp78hl.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
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.5 (/)

On 01.05.2022 15:17, Eli Zaretskii wrote:
> I don't understand how can completion work in general without
> destructively modifying strings.  Isn't that obvious?

It shouldn't modify the strings "owner" by outside code. String that can 
be referenced by other constants/functions/etc.

The easiest way to avoid that is to copy the whole collection and then 
modify the copied strings. But different approaches exist.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 20:53:02 +0000
Resent-Message-ID: <handler.55205.B55205.165143835512487 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>, Daniel Mendler <mail@HIDDEN>
Cc: Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165143835512487
          (code B ref 55205); Sun, 01 May 2022 20:53:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 20:52:35 +0000
Received: from localhost ([127.0.0.1]:34326 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlGYV-0003FL-BQ
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 16:52:35 -0400
Received: from mail-wr1-f45.google.com ([209.85.221.45]:46899)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nlGYU-0003F6-0m
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 16:52:34 -0400
Received: by mail-wr1-f45.google.com with SMTP id i5so17338760wrc.13
 for <55205 <at> debbugs.gnu.org>; Sun, 01 May 2022 13:52:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=k5Zc564RY/7AyS2nBCC58/I/23CagAKgkdGb0+p4o7g=;
 b=ROhHBR4BE6C7aeVZLwdzgcGNtGccXOWQmkZ2X3hFVIhD+eCj31cDV3u6EyCzOAiZZI
 RnGR2Ry7GHkBhGWrue9SXmhKlCT0bR/S9+erFIMZCvSPb+WICAvfcjD6mBx5voRowbxp
 2jfmz5+XvB7Gs4JywbTw+ubVV63rhxQ7mnsbBfL6+6GlS+62HgtK04LiBH5PM+4a3HGi
 pC7gDZYCupAV3yj4gkF/ER/VJtp7RBt4Dow+FASjr2riQL8WIJuGwaWU1k3tBJydPJRQ
 lfeUu491oRhDRAPGS05FReI/UJGUCf8QW8ERuIrLP7PywZaWJk+ULDW6mIJxhCMtpMLq
 cmsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=k5Zc564RY/7AyS2nBCC58/I/23CagAKgkdGb0+p4o7g=;
 b=bITtQrlW7N0kfV76XVHLsayMlxKzuNYd0teFjqgoaAjfgJx1Mv8bN5sIB3JhAEiXBF
 rJ7eeMZZbx65bh1OQcqQ8tepGkSInKwgpZSUYEk5TdHDubEsrAU00v1w8poDBPZnX93I
 09Fd8vntsXo4frfhyUKw1PB8z8W9QzsZVsV+/h6CosTC2eZ7qVn5D3Xr6cTsdJTpK84L
 ML5zOyAsBO7ja1/3M2obpNLlGbj6FeHPFoZNQdeKvexQSJH2dfOoSx2WuBeBN5Y31dx8
 J9FujtK7nOiedJZ4S7eTaL/l9pXozXPEMUKBzjz5FL8jZEob7dvTJlq7p6B1U94r1zya
 LJkw==
X-Gm-Message-State: AOAM5305/Kh/Hd2jv78Xd7XrOTwaEvUFmUeT4I+F2a0OD8YrLTc3MaRS
 ao5ykpXqf3iiXTZ/HdEeUBc=
X-Google-Smtp-Source: ABdhPJzjNUtAykPARHZ6tNnBKdl6+iG0fWerrzCDsbVpcG3rTYRenDdiyjhw9R5oz/hrDMEXSFluYA==
X-Received: by 2002:a5d:6085:0:b0:20a:d53f:4b82 with SMTP id
 w5-20020a5d6085000000b0020ad53f4b82mr7157220wrt.179.1651438346926; 
 Sun, 01 May 2022 13:52:26 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 22-20020a05600c021600b003942a244eddsm5863905wmi.34.2022.05.01.13.52.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 01 May 2022 13:52:26 -0700 (PDT)
Message-ID: <bdb42c76-d657-7e8f-f957-0cb51c6dc478@HIDDEN>
Date: Sun, 1 May 2022 23:52:23 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
 <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
 <87a6c1cbs4.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <87a6c1cbs4.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
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.5 (/)

On 01.05.2022 22:07, Lars Ingebrigtsen wrote:
> Daniel Mendler<mail@HIDDEN>  writes:
> 
>> Yes. Just disambiguate the candidate strings. For example in the imdb
>> use case, you could append the year when the movie appeared.
> Like I said, there's sometimes several movies the same year with the
> same name.

Then you could probably pre-process the list, and for the fully-equal 
movies with different ids also append their imdb ids to the names.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 20:55:03 +0000
Resent-Message-ID: <handler.55205.B55205.165143848112748 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165143848112748
          (code B ref 55205); Sun, 01 May 2022 20:55:03 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 20:54:41 +0000
Received: from localhost ([127.0.0.1]:34342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlGaW-0003JX-MS
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 16:54:40 -0400
Received: from quimby.gnus.org ([95.216.78.240]:35002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlGaU-0003JK-Uj
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 16:54:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=pKxUJpd+xHsd3iBKWP0rlCFxC/U6cD7iyHwdKZfTqRU=; b=rlF68X2Qdj2LAurEkngvRL0oJl
 R5Jia2C+SuL4DdlDizgysGt+CijApY69Bfr7oi14zpx5DmwAroT+nXOImxCOpBCZ7p1DyVOLBtWXY
 JMBwmUdK34HF3HP9MH1LVJpb/jmD39Bk2Aoo0Pw0mJQccba0aBGGxmUIdc5hEp+cxcT4=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlGaL-0001Nr-3f; Sun, 01 May 2022 22:54:31 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
 <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
 <87a6c1cbs4.fsf@HIDDEN>
 <bdb42c76-d657-7e8f-f957-0cb51c6dc478@HIDDEN>
X-Now-Playing: Bogdan Raczynski's _Mixes_: "Mix 4"
Date: Sun, 01 May 2022 22:54:25 +0200
In-Reply-To: <bdb42c76-d657-7e8f-f957-0cb51c6dc478@HIDDEN> (Dmitry Gutov's
 message of "Sun, 1 May 2022 23:52:23 +0300")
Message-ID: <87y1zlas8u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Dmitry Gutov <dgutov@HIDDEN> writes: > Then you could
 probably
 pre-process the list, and for the fully-equal > movies with different ids
 also append their imdb ids to the names. Yes, of course I can do that. But
 I didn't want to that (because it's doubleplusungood), so I had to copy half
 of minibuffer.el into my project and alter it. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Dmitry Gutov <dgutov@HIDDEN> writes:

> Then you could probably pre-process the list, and for the fully-equal
> movies with different ids also append their imdb ids to the names.

Yes, of course I can do that.  But I didn't want to that (because it's
doubleplusungood), so I had to copy half of minibuffer.el into my
project and alter it.

(Only exaggerating slightly.) 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 21:31:01 +0000
Resent-Message-ID: <handler.55205.B55205.165144061424636 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165144061424636
          (code B ref 55205); Sun, 01 May 2022 21:31:01 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 21:30:14 +0000
Received: from localhost ([127.0.0.1]:34388 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlH8v-0006PG-Lx
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 17:30:13 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:34795)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nlH8u-0006Ny-F3
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 17:30:12 -0400
Received: by mail-wm1-f48.google.com with SMTP id
 az27-20020a05600c601b00b0039431ba4905so913513wmb.1
 for <55205 <at> debbugs.gnu.org>; Sun, 01 May 2022 14:30:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=QshDe1/jYolWSi4CEQ8iU2zrX8Fk801V/Go6KzWa0Mk=;
 b=SZV21W8sGfJh6wkTvuUeVrhfaxjnWGY/fcYWBqHffIW944k0/cmE1sq5p0iJwPPk9W
 y5fG4eajLzZ7sz1ohwA9z4YNGslRI+uzv5vQDy6k2VUAogz7BWIPwfsyWdVK95GoQX2p
 Oy1Lh7GJLsf206OE/vIbZ/n05PkeZwrIy6L3t8Q5KX4CCXGgd/w6p3Xg753Gjs7fkvVe
 8GJklI7APWFrJQDF7A36yQLo+M2XEnF2G2XXATMnX2vTlRs7qOU/iKmT2Trc46+G2K0a
 4xUjqb3lvB41db4CPI7QRDoe8wpf6/ODIKWf+Wex3qcI10HMXl2Qh4vj24GkYvr3k382
 Ou/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=QshDe1/jYolWSi4CEQ8iU2zrX8Fk801V/Go6KzWa0Mk=;
 b=zXDVUAa2L93/xfR9D3czh+iVsC8HrgowjqmoCPQMTq/yuaLP4YbbhSmCdtT6Z65pvH
 ME0fwSk5ykpVuWr/YYQuvPI5KMX6QFyYzlSDarCBlFK56yIKhAR+tPekiy4rn3TxMDCH
 8fpOdHlohGmgyCYOx09fyTPuW3yrWb/XOwPwX7Fvg/UAX2k/A68CkyTSFxk//cATXvdK
 joDH3dh6clDUQ1uPSUA7nBaDhcpdlBf5uyUd1SLmcjcI5XvTblEoeJ1AC1hbbyuTwDCq
 99Z0KayfbEKWQ+JnTbutKtkEfxg/OwRYIy26FddbYN/XC+q75DG2Zr8Rrh/ZrR+hiZJ1
 ES4A==
X-Gm-Message-State: AOAM533vzmqKdjuNKJKtvnmbbJdZGDZlfpw+Pxrmha1I3TfGHodigKfw
 nI+qYlf41qmLaSRA1xVYhBE=
X-Google-Smtp-Source: ABdhPJzGG+4SnTdblPoKiZqs5ragdv+CYrUpRWgbu6XqwcLF+81BnS43EHCeYYzYPNBYlf++Xlh/6Q==
X-Received: by 2002:a05:600c:4f49:b0:393:f12e:b754 with SMTP id
 m9-20020a05600c4f4900b00393f12eb754mr8665956wmq.97.1651440606520; 
 Sun, 01 May 2022 14:30:06 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 16-20020a05600c231000b003942a244f40sm4786194wmo.25.2022.05.01.14.30.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 01 May 2022 14:30:06 -0700 (PDT)
Message-ID: <b4302e9c-4291-178e-eada-991274ac900d@HIDDEN>
Date: Mon, 2 May 2022 00:30:04 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
 <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
 <87a6c1cbs4.fsf@HIDDEN> <bdb42c76-d657-7e8f-f957-0cb51c6dc478@HIDDEN>
 <87y1zlas8u.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <87y1zlas8u.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
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.5 (/)

On 01.05.2022 23:54, Lars Ingebrigtsen wrote:
> Yes, of course I can do that.  But I didn't want to that (because it's
> doubleplusungood), so I had to copy half of minibuffer.el into my
> project and alter it.

IDK. When thinking about the properties-equality problem, I also ended 
up with this approach as the most failsafe.

The added bonus is that a keyboard-inclined user will be able to choose 
between the two solely by typing.

Of course a different UI paradigm could create a different answer (of 
the "selection" rather than "completion" variety). But for generic code, 
we cannot yet rely on that UI being available. Or suitable for all users 
(if we're talking about fido-vertical-mode, which is in the core).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 01 May 2022 21:44:02 +0000
Resent-Message-ID: <handler.55205.B55205.165144142625846 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165144142625846
          (code B ref 55205); Sun, 01 May 2022 21:44:02 +0000
Received: (at 55205) by debbugs.gnu.org; 1 May 2022 21:43:46 +0000
Received: from localhost ([127.0.0.1]:34396 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlHM2-0006io-7v
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 17:43:46 -0400
Received: from quimby.gnus.org ([95.216.78.240]:35386)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlHM0-0006iX-It
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 17:43:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=INFhp2Fr40GZumNTb8wMFlbHWyS7ibA8UN9R/PQCeVE=; b=p45OqGoUFaXIs7WZzE7D1GTb8z
 LVq9p+YrzR5UlEzEAeCvjJFod1oqKqW1sVQqMMZR0UtZYNDfhT4kbg/cCkzT2hplFTeyJk2nuzqii
 IwbvorD1NFFMRJrOv7Vei/RvFZBlNiKHy0/amy9vt8RwypTR+z6hyXeGnJVuR273KxJk=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlHLq-0001xS-0W; Sun, 01 May 2022 23:43:36 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
 <ec9b1cc3-b148-ed24-1cd4-2486c8ee67ff@HIDDEN>
 <87a6c1cbs4.fsf@HIDDEN>
 <bdb42c76-d657-7e8f-f957-0cb51c6dc478@HIDDEN>
 <87y1zlas8u.fsf@HIDDEN>
 <b4302e9c-4291-178e-eada-991274ac900d@HIDDEN>
X-Now-Playing: Bogdan Raczynski's _Mixes_: "Mix 5"
Date: Sun, 01 May 2022 23:43:33 +0200
In-Reply-To: <b4302e9c-4291-178e-eada-991274ac900d@HIDDEN> (Dmitry Gutov's
 message of "Mon, 2 May 2022 00:30:04 +0300")
Message-ID: <87k0b5apyy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Dmitry Gutov <dgutov@HIDDEN> writes: > The added bonus
 is that a keyboard-inclined user will be able to > choose between the two
 solely by typing. The new `M-<down>' the keyboard is excellent for choosing
 between (textually identical) candidates. :-) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Dmitry Gutov <dgutov@HIDDEN> writes:

> The added bonus is that a keyboard-inclined user will be able to
> choose between the two solely by typing.

The new `M-<down>' the keyboard is excellent for choosing between
(textually identical) candidates.  :-)

> Of course a different UI paradigm could create a different answer (of
> the "selection" rather than "completion" variety). But for generic
> code, we cannot yet rely on that UI being available. Or suitable for
> all users (if we're talking about fido-vertical-mode, which is in the
> core).

The standard one is more than sufficient.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Richard Stallman <rms@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 00:35:02 +0000
Resent-Message-ID: <handler.55205.B55205.165145165611120 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: mail@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Reply-To: rms@HIDDEN
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165145165611120
          (code B ref 55205); Mon, 02 May 2022 00:35:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 00:34:16 +0000
Received: from localhost ([127.0.0.1]:34518 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlK12-0002tI-7z
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 20:34:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1nlK0z-0002sq-Uv
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 20:34:14 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47336)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rms@HIDDEN>)
 id 1nlK0t-0005Nj-Ub; Sun, 01 May 2022 20:34:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
 mime-version; bh=wCrDHTAOwEuWHwK5slGosUDheLSAIfys/3riXf/HrLQ=; b=AP6/n77zd6ZX
 RZsAjMD+20EVQ5B93pShzUcI+A0KL5hSCme8rS1OCg06Md6L+FBWBhZgIvPtATM0ienmN5Btx+T5p
 mNSUfcz6yg14JqQzPU60++roOIsmXujPSoU1BZA/xjr9kACO9WvPzdVUXIAHVDbnNuKB6kACDGx6c
 jWs736BnSkyjl7n8r2P1O3TGpvNNLMaZbnNHepiOCKGU+bC/Xp15awQouZDaelzhOjNyPsG5NH+Df
 x1RIvRMwQIgiPqhWQsksx/BgmgXlu3xr7uNRuGgddmJzRBt9CSJCb0jc+TNyoUl/ZgznB/iCLzVI4
 TbAWGVbNV+d985hdOasang==;
Received: from rms by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1nlK0t-0003GK-Ie; Sun, 01 May 2022 20:34:07 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
In-Reply-To: <87wnf5mpt4.fsf@HIDDEN> (message from Lars Ingebrigtsen on Sun, 
 01 May 2022 13:53:59 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN>
Message-Id: <E1nlK0t-0003GK-Ie@HIDDEN>
Date: Sun, 01 May 2022 20:34:07 -0400
X-Spam-Score: -2.3 (--)
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 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > The function completion--replace mutates the replacement string, it
  > > strips the text properties.

  > I don't think that's, strictly speaking, illegal.  :-)

I don't think Emacs Lisp faces a danger of being prosecuted for this.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 02:24:02 +0000
Resent-Message-ID: <handler.55205.B55205.165145819221245 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165145819221245
          (code B ref 55205); Mon, 02 May 2022 02:24:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 02:23:12 +0000
Received: from localhost ([127.0.0.1]:34556 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlLiS-0005Wa-0P
	for submit <at> debbugs.gnu.org; Sun, 01 May 2022 22:23:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlLiQ-0005WM-OA
 for 55205 <at> debbugs.gnu.org; Sun, 01 May 2022 22:23:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48676)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlLiK-0001lZ-4R; Sun, 01 May 2022 22:23:04 -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=sVzIjRVD5zvUKhTuBrM4ftwDwmAg2LvbmiGta8OJHAo=; b=c22D8LvzSywC
 EbbBYhIfW7/SSFEjBRO9Y0yXF7Nq5cIJRXNIDTKHO4bTPWUki0EQvMq3+kUuGtTYS8ICZQLyv0fUC
 V4fE1SX0+WLPeIYqX4kOZ1AIfN5xMbg3wDfqArWzu+j/W2YiopVCl1GYhUCMcciiBmXHdMzSD2Eoh
 1MCDvoFZCj5Id8qQBkhj3PXEEUYI4H7g3RchWHmcmEVIEVcpNVuxNOZk2nYZZnPYI48KMriUKrYiU
 ivTsVT4AlVHSP7i5cCtnaz+/jIr9e/erm5GWwOE73DBDV97m2HVdR9WQhzjCG35nXJYWksxvRAa1O
 TpVS7voQ+c+PjXVghnBYUQ==;
Received: from [87.69.77.57] (port=3201 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlLiJ-0002x7-An; Sun, 01 May 2022 22:23:03 -0400
Date: Mon, 02 May 2022 05:23:10 +0300
Message-Id: <83czgw65bl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN> (message from
 Dmitry Gutov on Sun, 1 May 2022 23:11:36 +0300)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Sun, 1 May 2022 23:11:36 +0300
> Cc: mail@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 01.05.2022 15:17, Eli Zaretskii wrote:
> > I don't understand how can completion work in general without
> > destructively modifying strings.  Isn't that obvious?
> 
> It shouldn't modify the strings "owner" by outside code. String that can 
> be referenced by other constants/functions/etc.
> 
> The easiest way to avoid that is to copy the whole collection and then 
> modify the copied strings. But different approaches exist.

Collection can include functions, and how do you copy that?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 06:32:01 +0000
Resent-Message-ID: <handler.55205.B55205.165147307512764 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165147307512764
          (code B ref 55205); Mon, 02 May 2022 06:32:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 06:31:15 +0000
Received: from localhost ([127.0.0.1]:34676 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlPaV-0003Jn-KL
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 02:31:15 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41567)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlPaU-0003Jc-K6
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 02:31:15 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0F3AA8049E;
 Mon,  2 May 2022 02:31:09 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E8959803D6;
 Mon,  2 May 2022 02:31:06 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651473066;
 bh=OyrRruXjmM8u3maekAarK1MDmRd7tDBYzDeCLHv/YHQ=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=IUh52yaVTJiuHcQioeyoCOjj/y2XdaIR5WdClXDmcYKocoZ3wK+p9PLsubYUkBQ/B
 y2Ah/5O+LgYLcGP9Se8jTuWdlZcwax2vuM4GmjL6ngBGYyqyoTRdatQynLKmUVzhL9
 e+pjFnCVE7fXF59WL6w5B3EyySTPsPfYDFiBkNKGWv7j+ljTMDVQ3S/gKdPTp5gSwb
 XbOt4GVqQf2KLli/uCoapcik6DnEIrfeX6BUGgRVz0HaCKCCFOh0cd3civXdlCX4Te
 tvF2p3Es5qT9X0yc9oa0JJHCUZMs6oSZ8IpY0CTf9Ipw30bozMzUOHaaIoNRVvJPN8
 RPfVIlZ2PsLUQ==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ABCE01201E1;
 Mon,  2 May 2022 02:31:06 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN>
Date: Mon, 02 May 2022 02:31:05 -0400
In-Reply-To: <8735htdrmt.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 01 May 2022 20:39:22 +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.056 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-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 (---)

> I've got an imdb interface where I choose among different movies (some
> with the same name) by putting the movie poster in the completion
> string to disambiguate.  That's the first place I ran into the problem,
> years ago (and it seems like people keep trying to do things like that,
> and then giving up).

I'm a strong proponent of "different completions should be selectable by
different strings", for the kinds of reasons exposed by Daniel: it makes
it possible to use more UI styles than just selection (and it interacts
better with other things like elimination of duplicates).

But FWIW, that is not a reason to force throwing away the text
properties (IOW the act of stripping the text properties is not
a feature of the code).

E.g. I'd recommend you always include the movie's unique ID in the
completions, probably covered/hidden by the movie's poster (so the ugly
ID doesn't show up).  And when the user selects that entry it would make
a lot of sense to keep displaying the poster.

> If I remember correctly, I ended up copying most of the completion
> machinery into the package just to avoid the stripping.

We should fix the code so it's not necessary.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 08:12:01 +0000
Resent-Message-ID: <handler.55205.B55205.165147910922134 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165147910922134
          (code B ref 55205); Mon, 02 May 2022 08:12:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 08:11:49 +0000
Received: from localhost ([127.0.0.1]:34721 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlR9p-0005kw-CY
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 04:11:49 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39974)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlR9n-0005ki-Qw
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 04:11:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From: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=LpLdDyb9PR+9GWLnN30BYQEAln4w5+0FGs3xRKsuaUI=; b=Ay3bl9Y8Xpgpo+lUG25q+QHDs6
 aw54taV4DnQSbXcOvJ6QWR3fBPzKye8KoT5bPva9sUa6mgpbJyJuGIYoUYku70pbDelY5LbqWylfC
 qDQeiJfaxzVV2Jq5D1g2avTcHKJWOVpDOMzOwgzMDPAo1E3cV4hCHLjJECOLzTRgXp8E=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlR9d-0006o2-3V; Mon, 02 May 2022 10:11:39 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
X-Now-Playing: Bogdan Raczynski's _Mixes_: "Mix 7"
Date: Mon, 02 May 2022 10:11:35 +0200
In-Reply-To: <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Mon, 02 May 2022 02:31:05 -0400")
Message-ID: <87wnf49ww8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Stefan Monnier <monnier@HIDDEN> writes: > I'm a
 strong proponent of "different completions should be selectable by > different
 strings", for the kinds of reasons exposed by Daniel: it makes > it possible
 to use more UI styles than just sele [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> I'm a strong proponent of "different completions should be selectable by
> different strings", for the kinds of reasons exposed by Daniel: it makes
> it possible to use more UI styles than just selection (and it interacts
> better with other things like elimination of duplicates).

If we have completions that are textually different, then that's no
problem, of course.  But requiring the callers to construct strings that
differ in artificial ways seems less than optimal.

> But FWIW, that is not a reason to force throwing away the text
> properties (IOW the act of stripping the text properties is not
> a feature of the code).
>
> E.g. I'd recommend you always include the movie's unique ID in the
> completions, probably covered/hidden by the movie's poster (so the ugly
> ID doesn't show up).  And when the user selects that entry it would make
> a lot of sense to keep displaying the poster.

I think that's what people normally do in these circumstances, but it's
a pretty confusing interface.  The completions show up looking
identical, but with hidden text that you can complete with.

>> If I remember correctly, I ended up copying most of the completion
>> machinery into the package just to avoid the stripping.
>
> We should fix the code so it's not necessary.

Which brings me back to my original question.  =F0=9F=98=80  Why are we str=
ipping
text properties?  Is this to fix some bug or something?

I.e., if we add an interface to allow completion to not strip text
properties, is that going to lead to bugs?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 08:50:01 +0000
Resent-Message-ID: <handler.55205.B55205.165148137610412 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148137610412
          (code B ref 55205); Mon, 02 May 2022 08:50:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 08:49:36 +0000
Received: from localhost ([127.0.0.1]:34791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlRkO-0002hs-Dj
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 04:49:36 -0400
Received: from server.qxqx.de ([178.63.65.180]:48107 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlRkM-0002he-3e
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 04:49:34 -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=i96/fdxgY4z6sjiJFKB0AbpRIRhyXMNMQ9HPZI84Uwc=; b=ml+R/J+cXJ8s6mOg7wRzuQw4bH
 4Jda1Pl5t10mdSdRt7AIZSrb+WaXtkI1mO4fklUxv9JcKUEw03xF4BbWHUopVDUHnjHyn1xb4t5La
 UzLPaWT9LD9o+aPS1kuCEXMyAaIwvaBN8vzi9YIw3Ncjd8LmE6AMWcTDG1+4MJYHF4Pk=;
Message-ID: <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN>
Date: Mon, 2 May 2022 10:49:25 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 08:31, Stefan Monnier wrote:
> I'm a strong proponent of "different completions should be selectable by
> different strings", for the kinds of reasons exposed by Daniel: it makes
> it possible to use more UI styles than just selection (and it interacts
> better with other things like elimination of duplicates).
> 
> But FWIW, that is not a reason to force throwing away the text
> properties (IOW the act of stripping the text properties is not
> a feature of the code).

As I understood, it is somehow a consequence of the way completion is
implemented, it is a step-wise input process via
completion-try-completion. If I enter pifb TAB it is essentially the
same as if I entered package-install-from-buffer. There is not really a
candidate lookup going on, the UI only ever sees the (maybe even
partially completed) string returned by the completion backend.

There are two ways out:

- The completion UI could lookup the original candidate string in a
final step just before returning from the minibuffer. This could only
happen when REQUIRE-MATCH non-nil.

- We throw away the entire paradigm of completion and go with selection
only. But I think we would lose to much by doing that.

But again, since Lars asked this - text properties are not stripped,
they never materialize in the first place due to completion just being a
form of user input. (Technically they are stripped, but only to
normalize the resulting input in case some text properties make it through.)

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 09:01:03 +0000
Resent-Message-ID: <handler.55205.B55205.165148202813096 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148202813096
          (code B ref 55205); Mon, 02 May 2022 09:01:03 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 09:00:28 +0000
Received: from localhost ([127.0.0.1]:34799 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlRut-0003Op-RU
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 05:00:28 -0400
Received: from server.qxqx.de ([178.63.65.180]:36093 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlRur-0003HF-Ht
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 05:00:26 -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=+wjSYK6bidScQHHmy8lEQ1UbMXB3TpegVgBpgNpQd68=; b=swr/IPHesIvmTEFCkrBeHVhdC9
 FY3TInMQO/6ZVEf8vmZBb0sBxS154XTZ4Z3cdUCKdCLxSIZh0pEB+XmR42zEcFAha6savmmXarWmm
 eSfJczDMbcZ9ptISD2eWNCR89IXN6fonbnsvGDKi2IdhrKh+HQ4Q+GfhbjVxR1UXedi8=;
Message-ID: <8eda03fd-975d-26f7-efe5-c0193a83d75a@HIDDEN>
Date: Mon, 2 May 2022 11:00:18 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <87wnf49ww8.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87wnf49ww8.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
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 5/2/22 10:11, Lars Ingebrigtsen wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
> 
>> I'm a strong proponent of "different completions should be selectable by
>> different strings", for the kinds of reasons exposed by Daniel: it makes
>> it possible to use more UI styles than just selection (and it interacts
>> better with other things like elimination of duplicates).
> 
> If we have completions that are textually different, then that's no
> problem, of course.  But requiring the callers to construct strings that
> differ in artificial ways seems less than optimal.

I argue that the strings should not differ in artifical ways. If you
want to select from different candidates which are actually different in
some ways. For example movies with the same name from the same year
certainly have different directors and different actors. The user can
then match against the name of the director when searching for the
movie. If the candidates would be truly "more equal", such that the
disambiguation suffix would be truly artificial, then why would you
distinguish the candidates in the first place?

>>> If I remember correctly, I ended up copying most of the completion
>>> machinery into the package just to avoid the stripping.
>>
>> We should fix the code so it's not necessary.
> 
> Which brings me back to my original question.  😀  Why are we stripping
> text properties?  Is this to fix some bug or something?
> 
> I.e., if we add an interface to allow completion to not strip text
> properties, is that going to lead to bugs?

I mentioned this in my other mail. The text properties don't necessarily
materialize in the first place, because it is just textual input by the
user. If a UI wants to enforce that text properties are returned it
could do so by performing a lookup in the final step and by setting
minibuffer-allow-text-properties. By stripping the text property we
ensure that the result is normalized and uniform across all scenarios.
As I mentioned before, text properties are only meaningful for
REQUIRE-MATCH non-nil and also not for the "null completion" (empty string).

Btw, I consider the "null completion" a design mistake which should be
corrected. If REQUIRE-MATCH is non-nil, no null completion should be
allowed. If the caller of completing-read truly wants the null
completion they can either modify the test-completion action of the
programmable completion table or pass the empty string as DEFAULT
argument to completing-read.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 09:05:02 +0000
Resent-Message-ID: <handler.55205.B55205.165148227120255 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148227120255
          (code B ref 55205); Mon, 02 May 2022 09:05:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 09:04:31 +0000
Received: from localhost ([127.0.0.1]:34815 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlRyo-0005Gd-Rg
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 05:04:31 -0400
Received: from quimby.gnus.org ([95.216.78.240]:40700)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlRyn-0005GQ-Lu
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 05:04:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=kQDWFG7umFTGxTvBIcIsW4IBhBonNM+Wz+HO8QUCNPw=; b=AHu2JFxxSffLBuROTrOd6NqdWz
 1MqWd0GPeJCFjHtuMq0/nx4aRKwOJ7zDj09Vf1CmjX/3v4lMKaFg2emsmDg2XKEhgiMEOOxj+migv
 BuKv0H+GxBDPC0VbBhfIOc1cj+lwmYX7pvsb9buwWNCEuiIn9TIlcfbiJehu+a2R/rWE=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlRyd-0007Iy-Ub; Mon, 02 May 2022 11:04:22 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN>
X-Now-Playing: Bogdan Raczynski's _Mixes_: "Mix 8"
Date: Mon, 02 May 2022 11:04:18 +0200
In-Reply-To: <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN> (Daniel
 Mendler's message of "Mon, 2 May 2022 10:49:25 +0200")
Message-ID: <87o80g486l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Daniel Mendler <mail@HIDDEN> writes: > But again, 
 since Lars asked this - text properties are not stripped,
 > they never materialize
 in the first place due to completion just being a > form of user input.
 (Technically they are stripped, [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Daniel Mendler <mail@HIDDEN> writes:

> But again, since Lars asked this - text properties are not stripped,
> they never materialize in the first place due to completion just being a
> form of user input. (Technically they are stripped, but only to
> normalize the resulting input in case some text properties make it through.)

I only want to keep the text properties when doing selection -- when the
user types something without selecting a candidate, then there are no
text properties to speak of.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 09:47:01 +0000
Resent-Message-ID: <handler.55205.B55205.16514847704555 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16514847704555
          (code B ref 55205); Mon, 02 May 2022 09:47:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 09:46:10 +0000
Received: from localhost ([127.0.0.1]:34881 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlSd8-0001BE-F7
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 05:46:10 -0400
Received: from mail-ed1-f42.google.com ([209.85.208.42]:44709)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nlSd6-00014P-K5
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 05:46:08 -0400
Received: by mail-ed1-f42.google.com with SMTP id t5so5359068edw.11
 for <55205 <at> debbugs.gnu.org>; Mon, 02 May 2022 02:46:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=h2T+9q6opg167id9DmaF7QPdtdEHFTidxdHpgFvYUmw=;
 b=h+pUUf8lFI3MAE0ZduzwcyDyIP/tSNuYhQUj1/w4kam90rJ746wBU+kdKlM7WJc04Q
 KnKdkIp7G/SO/RjL178HPqSzhDGYBMJVLMhwuJfMPDZ+YYJdz5abUK9RCASn3zulvZyi
 6v8Ze/qbWKc9d286dMt0poqjFkrrf69Z7fT6g5Mx7+Rb7k/2OQ0z4/YeKP9DhxwiC5Cq
 IKFqFJBoYfwgzejQCRDG0MdODjg/QGje0mVliXUhnPRRep1bI9WkBDwd3dmyNnwHKGM8
 gbBCS+ZKGFzqNYRbL8/WCmn9dA6EiOa/Bgtu+iR2hm7/C4clvi6O57wmnEI6SUSXBQkd
 KuKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=h2T+9q6opg167id9DmaF7QPdtdEHFTidxdHpgFvYUmw=;
 b=7lw1RZC1NC/kSdYaYVGh7FiSWhpfiKrVK6/24x6fA4Y2PC3outMzDZV58aes2Z2qpv
 NYHq53WqfH4DuchxzmIYxt+6mfyjivvoq85J1UAbTchVCacXVlsLA+R+LLJoyiNZrY8c
 lSQemdTaa2PV3fIU+vwb2ESIywLc78zWZwAzYczMqyqwrra8n8pYaoCQ+EWHQy5MNFhu
 Q6hJ4hBR4PPX4i8aDHA1ET0kXUD5qFooYvxv4L8e0GoPGlQj+vOCyTxMm2L79ADKl3oG
 tqDhS874XfiReLemq330J5lhlGCO/zvIg1Xi40bsheft3KrDl6HABFEQD4NzgNIG8ec2
 RwUg==
X-Gm-Message-State: AOAM531h+OAPmohv0rl7tGKkMARiggwRn9zkwR3Wb+NnXa3n+OcDkmNP
 q78g/59f3adbwBut1qFEO/w=
X-Google-Smtp-Source: ABdhPJxdg9koMBkhFrmN03ErIDZbQ+QE/vnaOLj5gAPkX1wsBWfwXUMwW/ypWNA882G2LB43hB5ynw==
X-Received: by 2002:a05:6402:50d0:b0:427:b483:6195 with SMTP id
 h16-20020a05640250d000b00427b4836195mr7884087edb.390.1651484762554; 
 Mon, 02 May 2022 02:46:02 -0700 (PDT)
Received: from [192.168.236.48] ([173.237.64.48])
 by smtp.googlemail.com with ESMTPSA id
 k6-20020aa7d8c6000000b0042617ba63d0sm6482490eds.90.2022.05.02.02.46.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 02 May 2022 02:46:02 -0700 (PDT)
Message-ID: <27ecd6cd-3c2c-d30c-24a3-d77e0331ebf6@HIDDEN>
Date: Mon, 2 May 2022 12:46:00 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN> <83czgw65bl.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83czgw65bl.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
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.5 (/)

On 02.05.2022 05:23, Eli Zaretskii wrote:
> Collection can include functions, and how do you copy that?

Collection can be a function, not "include functions". You fetch the 
list of strings using that function (for the given input) and then make 
a deep copy of that.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 09:58:01 +0000
Resent-Message-ID: <handler.55205.B55205.165148547410429 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148547410429
          (code B ref 55205); Mon, 02 May 2022 09:58:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 09:57:54 +0000
Received: from localhost ([127.0.0.1]:34910 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlSoU-0002i9-H5
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 05:57:54 -0400
Received: from server.qxqx.de ([178.63.65.180]:50071 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlSoT-0002ht-6H
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 05:57:53 -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=BSbbCryhCHcY/zCRQ3nbyC8TkC18n3tKhOgrcUSzRoM=; b=VuTfHDcWotuP5mo7bH6LtrqWZ0
 2amzAKr3qKhGVOGvvJMjxE9/GOZdVHPtmDbvd9zfdbuyhm2khWn1z6RjTU9CBKfv5+7902tzXVoa0
 TlRNoBbUYLSYuFjlN8+hSvgLk6q3YZQerrbWRJZAoVlPThqhdBeWI6uZeWljwdHal9HI=;
Message-ID: <552469c2-d4d3-3caa-016a-a454f3e53779@HIDDEN>
Date: Mon, 2 May 2022 11:57:44 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN>
 <87o80g486l.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <87o80g486l.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 11:04, Lars Ingebrigtsen wrote:
> Daniel Mendler <mail@HIDDEN> writes:
> 
>> But again, since Lars asked this - text properties are not stripped,
>> they never materialize in the first place due to completion just being a
>> form of user input. (Technically they are stripped, but only to
>> normalize the resulting input in case some text properties make it through.)
> 
> I only want to keep the text properties when doing selection -- when the
> user types something without selecting a candidate, then there are no
> text properties to speak of.

Okay, but that's not a good idea since then the return value of
completing-read will differ depending on the way the user performed
selection or completion. The caller of completing-read will have to
handle return values without text properties anyway so nothing is won by
returning strings with text properties only *sometimes*. The more
conservative approach is then to never return strings with text
properties as completing-read does currently.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 10:08:02 +0000
Resent-Message-ID: <handler.55205.B55205.165148605919944 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148605919944
          (code B ref 55205); Mon, 02 May 2022 10:08:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 10:07:39 +0000
Received: from localhost ([127.0.0.1]:34927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlSxv-0005Bc-CK
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 06:07:39 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nlSxt-0005BN-Cw
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 06:07:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 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=/jZLQzO7MNzwl4lwmqTo/pq7tgA2UmFnDA3L1JoCLQk=; b=L6lWZRjWcGzaKAWlw2moZBFR9h
 7e5MecuAy8ZAEscD0SiBWtEoGYZYEGUiWZwrIXbOtCFlyoCxhC9kjIPNG0o+9MIaE+62u3FYpMN8E
 ETQ+YwCqb0NtdWTWHDXLEV6kvt8Ap57d/mQqW19Mfda0F90Nzxa3ThP1Udwk0eATPWl4=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nlSxk-0007pv-3E; Mon, 02 May 2022 12:07:30 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN>
 <87o80g486l.fsf@HIDDEN>
 <552469c2-d4d3-3caa-016a-a454f3e53779@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXBLytugowtHjb/
 //8nJMasAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YFAgkgGZAeoikAAAFaSURBVCjPbZKxboMwEIav
 KEQqUxakqlNG6qeIKnXp1EicVZi60IGniDJm6mKkMhEkLPuesr/tkKlnYe7jP5/vbIjyrYgwt3Ii
 onynuOlYiyPab3LmpjdaosSwjlmCVCbQkJIgA6ZeKA+fRDwjBZUBrFhoQqytyCDDYAK0ksy3gN5G
 fxAkYFkBqdeoYNSvHiSSf0FkWWHBY+6Atf4O7QqnSnmUlxK4gyp8hEU3Xf2UhxojMH+GdgCI7mr3
 cFMY0i5PiuH6yPwGGGm2Yz3ToWQLuMaNcBShhZ/N8/LuMoNyfun6OC5atsiDcr5KhwPU5ju0cGS3
 6HHUsR9mL6a1feyHa7zG2AYD1K0lB+DkzjIFmGNQJqeauOxbrHZFRR8Yjc9wZ7SnVzrQFvFEBZEi
 XHGFMUGTNFceM4JDeDIFmG5+Fg/+Lkx4qui/FCqol/DPFJMK8dl5Kugi2JT+AEe//Y/vZgxIAAAA
 JXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA1LTAyVDA5OjMyOjI1KzAwOjAwkXmTpQAAACV0RVh0ZGF0
 ZTptb2RpZnkAMjAyMi0wNS0wMlQwOTozMjoyNSswMDowMOAkKxkAAAAASUVORK5CYII=
X-Now-Playing: Pet Shop Boys's _Inner Sanctum (1)_: "Love Comes Quickly"
Date: Mon, 02 May 2022 12:07:27 +0200
In-Reply-To: <552469c2-d4d3-3caa-016a-a454f3e53779@HIDDEN> (Daniel
 Mendler's message of "Mon, 2 May 2022 11:57:44 +0200")
Message-ID: <878rrk2qow.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Daniel Mendler <mail@HIDDEN> writes: > Okay, but
 that's not a good idea since then the return value of > completing-read will
 differ depending on the way the user performed > selection or completion.
 The caller of completing-read will ha [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
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 (---)

Daniel Mendler <mail@HIDDEN> writes:

> Okay, but that's not a good idea since then the return value of
> completing-read will differ depending on the way the user performed
> selection or completion. The caller of completing-read will have to
> handle return values without text properties anyway so nothing is won by
> returning strings with text properties only *sometimes*.

Of course there's something won by returning the exact, non-stripped
string when the user has selected one of the choices.  It tells us
exactly that -- that the user has chosen between one of the (textually)
identical versions.

In imdb-mode, if the user has selected a film, it displays that directly.
If the user types in a film name without making a selection, it pops up
a new buffer and asks the user to choose between the alternatives.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 10:19:01 +0000
Resent-Message-ID: <handler.55205.B55205.165148668329469 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165148668329469
          (code B ref 55205); Mon, 02 May 2022 10:19:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 10:18:03 +0000
Received: from localhost ([127.0.0.1]:34942 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlT7y-0007fF-NH
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 06:18:02 -0400
Received: from server.qxqx.de ([178.63.65.180]:57583 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlT7w-0007ej-Mz
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 06:18:01 -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=kOv71x97NXHsUvZZHuBlnY710od7TV5qFsfUxTZcYo8=; b=D0DE7RRK+HtlSry/XSNx5q/QfO
 PrcI7q+4iC8qeq1myCSiXgye9JPTuAoEj758abStJ5Pzvg3+mMTEDuRmdhlpOWRfdvk5mcx9mM7et
 GAzrrW3J4Hm35oznJsZSDtk450bW+Yo46jwKJDx7Y3dFzCYvx4xmWZuSBxa/O30WfNCk=;
Message-ID: <0ecea0f0-45ac-f5bd-91b6-07d713540264@HIDDEN>
Date: Mon, 2 May 2022 12:17:53 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <e59133cf-b305-6cb8-7f06-3b76a87c0b7c@HIDDEN>
 <87o80g486l.fsf@HIDDEN>
 <552469c2-d4d3-3caa-016a-a454f3e53779@HIDDEN>
 <878rrk2qow.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <878rrk2qow.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 12:07, Lars Ingebrigtsen wrote:
> Daniel Mendler <mail@HIDDEN> writes:
> 
>> Okay, but that's not a good idea since then the return value of
>> completing-read will differ depending on the way the user performed
>> selection or completion. The caller of completing-read will have to
>> handle return values without text properties anyway so nothing is won by
>> returning strings with text properties only *sometimes*.
> 
> Of course there's something won by returning the exact, non-stripped
> string when the user has selected one of the choices.  It tells us
> exactly that -- that the user has chosen between one of the (textually)
> identical versions.

Okay, if you want that, then you can consider that an advantage. I still
argue that this will lead to more bugs in the end since people will
start to rely on text properties being always available. This is
particularly problematic for completion UIs like Icomplete/Vertico/Ivy,
which always select. These UIs will then always return propertized text
strings and as a consequence users, package developers will assume that
text properties are always there, while normal default completion (when
not selecting via the Completions buffer) will never return propertized
strings.

Anyway, I think I cannot convince you here. As I said, I changed my
opinion on this topic after I gained more experience with writing
completion UIs (Vertico, Corfu and I contributed to others) and
completion functions. Originally I also wanted propertized strings but
now I believe it is better to go with the more restricted API, which
behaves uniformly over all scenarios.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 12:25:01 +0000
Resent-Message-ID: <handler.55205.B55205.16514942484589 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16514942484589
          (code B ref 55205); Mon, 02 May 2022 12:25:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 12:24:08 +0000
Received: from localhost ([127.0.0.1]:35060 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlV60-0001Bw-DS
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 08:24:08 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:12370)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlV5y-0001BN-4F
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 08:24:06 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B84B610028F;
 Mon,  2 May 2022 08:24:00 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D8987100121;
 Mon,  2 May 2022 08:23:58 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651494238;
 bh=FTMvhq8fqUOFjY3KVBJQ6zuOBzDutsYIraHT/ZwOgpc=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=F8F/yRsfMd25ZewjsnxgQ2cjrbVD8hHcGk0Q9PyAVYkLj6p1dCdBvH0/4YQllxX9I
 ok4BH5+3jdnDf1yT1dATboEYnBXA14GbH52UvWvK8GoOY9eXQ8icrReCFh73eq2Hn6
 siFqEmRUQYhZ5UklDvtkUbymX7fOQcSqQ2iitLqKefr51Pw/INv6ieakWkgL1kKvmX
 j7EF5446Ou/v4f99BQSIzCp07hqpMoaZtGmBLIh6yNDxMcArxOkfcTxoKPyyqmzjF6
 +UT3Qm6QDHAqCC+KLUs0xzrUFN74k4EGgpvCpdQW0kq7Vf4vVSpWJJzMF5SILccjuZ
 cQ/n4PAnwdFRQ==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 84D841201A4;
 Mon,  2 May 2022 08:23:58 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwva6c0jg8s.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <jwv7d75chrf.fsf-monnier+emacs@HIDDEN>
 <87k0b5duzh.fsf@HIDDEN>
 <ebfd6bb6-1db3-9cba-499c-4bdf45f97a82@HIDDEN>
 <8735htdrmt.fsf@HIDDEN> <jwvwnf41mg4.fsf-monnier+emacs@HIDDEN>
 <87wnf49ww8.fsf@HIDDEN>
Date: Mon, 02 May 2022 08:23:57 -0400
In-Reply-To: <87wnf49ww8.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 02 May 2022 10:11:35 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
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.044 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-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 (---)

Lars Ingebrigtsen [2022-05-02 10:11:35] wrote:
> Stefan Monnier <monnier@HIDDEN> writes:
>> I'm a strong proponent of "different completions should be selectable by
>> different strings", for the kinds of reasons exposed by Daniel: it makes
>> it possible to use more UI styles than just selection (and it interacts
>> better with other things like elimination of duplicates).
> If we have completions that are textually different, then that's no
> problem, of course.  But requiring the callers to construct strings that
> differ in artificial ways seems less than optimal.

The strings used for completions are the "identity" of each completion.
so if there are two distinct completions, they should have
distinct strings.  I don't see what's artificial about it.

Somehow the user (and the code) needs to be able to distinguish between
the various identically named movies.  You do that with a poster image
and I'm suggesting that this poster image should be covering some
"unique" identification information.  I.e. something like:

    (concat movie-name (propertize movie-id 'display movie-poster))

The `movie-id` could be derived from the poster itself if needed.
I can't see why you'd find that to be a problem.

You can also move the movie to an "annotation" and make movie names
unique by adding a number, something like:

    (defun movie-make-unique (movies)
      "MOVIES is a list of (MOVIE . IMAGE).
    Return a new list of (MOVIE . IMAGE) where every MOVIE is unique."
      (let ((ht (make-hash-table :test 'equal)))
        (mapcar (lambda (m)
                  (let* ((name (car m))
                         (old (gethash name ht))
                         (new (if (null old) m
                                (unless (cdr old)
                                  (setf (caar old) (concat (car old) " (1)"=
)))
                                (cons (format "%s (%d)" name (1+ (length ol=
d)))
                                      (cdr m)))))
                    (setf (gethash name ht) (cons new old))
                    new))
                movies)))

We could add such a function to `minibuffer.el`.

>>> If I remember correctly, I ended up copying most of the completion
>>> machinery into the package just to avoid the stripping.
>> We should fix the code so it's not necessary.
> Which brings me back to my original question.  =F0=9F=98=80  Why are we s=
tripping
> text properties?  Is this to fix some bug or something?

The rest of the discussion made me realize that maybe I misunderstood
your question.  Are you talking about the stripping that takes places
*during completion* (e.g. when clicking in *Completions*) or are you
talking about the stripping that takes place just before returning the
value of `completing-read`?  Some other?

> I.e., if we add an interface to allow completion to not strip text
> properties, is that going to lead to bugs?

What do you mean by "interface"?  You mean a UI or an API?
For an API it would probably lead to this API being virtually unusable
for some UIs.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 14:28:01 +0000
Resent-Message-ID: <handler.55205.B55205.165150163518902 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165150163518902
          (code B ref 55205); Mon, 02 May 2022 14:28:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 14:27:15 +0000
Received: from localhost ([127.0.0.1]:37639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlX15-0004uk-2p
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 10:27:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57652)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlX13-0004uX-7g
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 10:27:09 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57096)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlX0v-0001E4-Vd; Mon, 02 May 2022 10:27:01 -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=DwP0i4C26Gf+sFFC/i3LxsMIouH77A92n1Jp37ENKR4=; b=DbzQJo7AdZp0
 2lhrK6sor/Vxl7wmBE7lwXJxWX7BxUrgQFdplcLY3+N6p01jSEIH0BsI91229goh7990EBDXzDX1M
 Iik3TFfr598IPtb/n1yWSJNrlg3c47zcvEUMTmKPUPuMJmWmBiq9VNKueoxtIrmm8MzJ6VJbdNXIK
 FbHVth6Nx7GuJNIKoQZBbiHczUipvFBO6IriCOIuQhTu0HE8r/+Z2banhs3aUrD5rV7pwCa8aDiq5
 VQnTGzDyiOyjCBxvn3kHuoCOpM3IF9Ip4fdgCpGDQ7WkznCDmzDCP+0km/nSy0PHyqymd0vn/2DnY
 LV2fIiY0JEi7u9jX4tQ0tg==;
Received: from [87.69.77.57] (port=3855 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlX0u-0004jE-8J; Mon, 02 May 2022 10:27:01 -0400
Date: Mon, 02 May 2022 17:27:09 +0300
Message-Id: <838rrk57sy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <27ecd6cd-3c2c-d30c-24a3-d77e0331ebf6@HIDDEN> (message from
 Dmitry Gutov on Mon, 2 May 2022 12:46:00 +0300)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN> <83czgw65bl.fsf@HIDDEN>
 <27ecd6cd-3c2c-d30c-24a3-d77e0331ebf6@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Mon, 2 May 2022 12:46:00 +0300
> Cc: mail@HIDDEN, larsi@HIDDEN, monnier@HIDDEN,
>  55205 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 02.05.2022 05:23, Eli Zaretskii wrote:
> > Collection can include functions, and how do you copy that?
> 
> Collection can be a function, not "include functions". You fetch the 
> list of strings using that function (for the given input) and then make 
> a deep copy of that.

So I need to call that function twice, is that it?  It is normally
called by the completion machinery out of my control.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:02:01 +0000
Resent-Message-ID: <handler.55205.B55205.165150728927982 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: mail@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165150728927982
          (code B ref 55205); Mon, 02 May 2022 16:02:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:01:29 +0000
Received: from localhost ([127.0.0.1]:37714 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlYUL-0007HF-9t
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:01:29 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlYUJ-0007H0-Tg
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:01:28 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7067F10028F;
 Mon,  2 May 2022 12:01:22 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D473F100121;
 Mon,  2 May 2022 12:01:20 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651507280;
 bh=KDgezYdiVx9dPVziNpE3ru1irvclYkyOAeJD5WRvbWs=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=LzZLEpD9Sf1bpJZeC9i6SYO86+XMapS6CYJFSvuUcRsqFimcyrMiMC2HFVDT6vaHs
 g5+qd+FTxg9i3GIjLHOVawfxCGWX0G8QXnsjC5SPXONX7eROJRbTprv1upENRVJzqy
 4Jtm30UY54UBXWU5y3GoNsP1JhtxuBtF5GWfp8rKjzlGKL5oat1teSK1B+OD3rusWC
 rnE3l7g0lK+gok+8nSayqicSIoaKLZjnKhM5ABaZ3rbdziXHR3grDljbEqeoH4qi00
 +hqtIiju9GymYX55puFDtTxSSsD6HYHbiNsBYNkmyP7IblLN/gz40rH6odlM2Wima/
 l5NFUtoVeaW7g==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E35E1204BD;
 Mon,  2 May 2022 12:01:20 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
Date: Mon, 02 May 2022 12:01:18 -0400
In-Reply-To: <835ymp78hl.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 01 May
 2022 15:17:10 +0300")
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.044 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-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 (---)

Eli Zaretskii [2022-05-01 15:17:10] wrote:
> I don't understand how can completion work in general without
> destructively modifying strings.

The completion API (i.e. between the UI code and the completion backend)
is basically functional: the backend is a function that can operate
without any side effects.

The only thing that may occasionally need to be "modified" is the buffer
that the user is editing (most often it's a minibuffer).

Why would the completion UI ever need to modify any of the data that
belongs to the completion backend?  Or are you thinking of some other
form of "modifiying"?  Or other strings?


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:25:02 +0000
Resent-Message-ID: <handler.55205.B55205.165150865131261 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165150865131261
          (code B ref 55205); Mon, 02 May 2022 16:25:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:24:11 +0000
Received: from localhost ([127.0.0.1]:37794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlYqJ-000888-Bd
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:24:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlYqF-00087d-U7
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:24:10 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60286)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlYq9-0000uk-C7; Mon, 02 May 2022 12:24:01 -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=IKp2HqSkCwc54OcydIXi429b0v5Z/wIqM72oEqBvne0=; b=WOZiBrzRYSKU
 Cf29/gFsaxQS0jjcST7mHsNTqkKlVgE8vJ6XTmJORuQ0uJZEjy0vIUZkiB1APzTiPrkdg8tClmmvi
 pVXCvKxYYfNrMzJAQvnygjgC/Dohl8F9BwqN5ElbyXEHnrWCZmZzJqPE+jGxesdrDMK0rtw0CYTDG
 XOkVe/Df0LicJGAIC1c+Ps5x2TwFIn5wnBbVbtcqflebd0ZW/0iXQcdO8gD4HGFNsh6seaVTQhy2C
 EcSZK0iuiFnh/3p53Qp6cBehgJXfnMwL52MWS6zdMEOAuREZx/eOzW5nxp0gO/yGcciPI6rvwiIXF
 q2hH29WDOZE5UP4NyaM1Jw==;
Received: from [87.69.77.57] (port=3158 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlYq8-0005Cv-T0; Mon, 02 May 2022 12:24:01 -0400
Date: Mon, 02 May 2022 19:24:10 +0300
Message-Id: <834k276gyd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Mon, 02 May 2022 12:01:18 -0400)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Lars Ingebrigtsen <larsi@HIDDEN>,  mail@HIDDEN,
>   55205 <at> debbugs.gnu.org
> Date: Mon, 02 May 2022 12:01:18 -0400
> 
> Eli Zaretskii [2022-05-01 15:17:10] wrote:
> > I don't understand how can completion work in general without
> > destructively modifying strings.
> 
> The completion API (i.e. between the UI code and the completion backend)
> is basically functional: the backend is a function that can operate
> without any side effects.
> 
> The only thing that may occasionally need to be "modified" is the buffer
> that the user is editing (most often it's a minibuffer).
> 
> Why would the completion UI ever need to modify any of the data that
> belongs to the completion backend?  Or are you thinking of some other
> form of "modifiying"?  Or other strings?

I have no idea.  The way you present this is waaay above my level of
understanding.

Completion takes text typed by the user and produces strings that the
user could possibly mean by typing what he/she typed.  Some part(s) of
the candidates can legitimately come from what the user typed, some
other part(s) could be invented by the completion machinery more or
less out of thin air.  Why should anyone expect this meat-grinder to
refrain from destructively modifying any of the involved strings?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:35:04 +0000
Resent-Message-ID: <handler.55205.B55205.165150927832328 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165150927832328
          (code B ref 55205); Mon, 02 May 2022 16:35:04 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:34:38 +0000
Received: from localhost ([127.0.0.1]:37827 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZ0P-0008PH-Sh
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:34:38 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:29119)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1nlZ0P-0008P2-4d
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:34:37 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4C59310028F;
 Mon,  2 May 2022 12:34:31 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 078B0100121;
 Mon,  2 May 2022 12:34:30 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651509270;
 bh=9L30ZDWR8g5lNBcmIj15kxTaDsEGdpgYak6Xn1XycOE=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=HQcI3Miq/RGXdvW2UjX/5j7uOTgMyEsvqVXTmFvhSuqm4SjkCvk88mt9UjPNgql3V
 6CrkOl5a7+ppgMqlrpkiyjbE1ido8Cf8vNpxeNThwEJfFKu0KcaZ8V2fZCmOqEtSCw
 O4TQCLnhEkERNamMPT3hTYLdA1JNAt7R5SHrcyB/exJzLP+qcKEbsPAeADb4kxZ6lc
 LXis9pTd13IJGm5Sxoyaw8Adu3YadFt+FNydPh42qKtgm8RJ+z6jQQdtGwIJVjPQHq
 2M4I5UzXRRU5R1wqpiADKxR268vz+g+lVdZm6H9OvrazXcrI6B3FNLLYBHOgJb160v
 NV6Oesqde186w==
Received: from pastel (unknown [45.72.221.51])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B73921203E4;
 Mon,  2 May 2022 12:34:29 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
Date: Mon, 02 May 2022 12:34:28 -0400
In-Reply-To: <834k276gyd.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 02 May
 2022 19:24:10 +0300")
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.044 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-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 (---)

> I have no idea.  The way you present this is waaay above my level of
> understanding.
>
> Completion takes text typed by the user and produces strings that the
> user could possibly mean by typing what he/she typed.  Some part(s) of
> the candidates can legitimately come from what the user typed, some
> other part(s) could be invented by the completion machinery more or
> less out of thin air.  Why should anyone expect this meat-grinder to
> refrain from destructively modifying any of the involved strings?

Because the overwhelming majority of strings are never modified.
It's very unusual to modify a string by side effect (as opposed to
creating a new string object via `concat`, `substring`, ...).
This is true in most languages, AFAICT, but it's definitely true in
ELisp.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:39:01 +0000
Resent-Message-ID: <handler.55205.B55205.165150952632762 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165150952632762
          (code B ref 55205); Mon, 02 May 2022 16:39:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:38:46 +0000
Received: from localhost ([127.0.0.1]:37841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZ4Q-0008WM-Hk
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:38:46 -0400
Received: from server.qxqx.de ([178.63.65.180]:47103 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlZ4P-0008W8-3D
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:38:45 -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=AKiNPzmJLc32JFGCtjxC+WXfQw8+8X/zsCVg09Yl1D0=; b=SW0PgikCF/Xxlu1EXTB2PT+zpn
 CVY8Dg9//ztXauUDXpW9Nd6mysaGznVfCFPZjMJcH9uMBWmTOVCrrEalj0/gvRodEalTsTdExJZW7
 w40iwgSSZ3ILr7ofp5kKi60J2wAexENaUrTKoA/DzYWolcWdnQdQT2QQkTCLk9Zt25ls=;
Message-ID: <698d2a57-db2a-1c8a-5fe1-305b1c37aea2@HIDDEN>
Date: Mon, 2 May 2022 18:38:37 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 18:34, Stefan Monnier wrote:
>> Completion takes text typed by the user and produces strings that the
>> user could possibly mean by typing what he/she typed.  Some part(s) of
>> the candidates can legitimately come from what the user typed, some
>> other part(s) could be invented by the completion machinery more or
>> less out of thin air.  Why should anyone expect this meat-grinder to
>> refrain from destructively modifying any of the involved strings?
> 
> Because the overwhelming majority of strings are never modified.
> It's very unusual to modify a string by side effect (as opposed to
> creating a new string object via `concat`, `substring`, ...).
> This is true in most languages, AFAICT, but it's definitely true in
> ELisp.

One should add that *by definition* of the completion API, mutations of
the supplied candidate strings don't take place. For example you can run
completion on strings from the obarray:

(completing-read "Symbol: " obarray)

It would be quite harmful if the symbol names are destroyed in the
process. I don't see the completion API as a meat-grinder. It is all
quite well-defined.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:44:01 +0000
Resent-Message-ID: <handler.55205.B55205.1651509827779 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Stefan Monnier <monnier@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.1651509827779
          (code B ref 55205); Mon, 02 May 2022 16:44:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:43:47 +0000
Received: from localhost ([127.0.0.1]:37854 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZ9G-0000CU-RW
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:43:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlZ9F-0000CI-6P
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:43:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60552)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZ99-0003fW-RH; Mon, 02 May 2022 12:43:39 -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=t0iwMlDUdq7SAvTCjSVtLXJb320/DJiWSwZI8UWBhV4=; b=R1Wym//C9sfT
 NJWh3eFagF0SRgLvXhUb5rZN6gKCibuQ0bxQxg/BpW0U2PNuA+9Dl7WsPS/hu7/LNI7B4O7/dkadd
 pIFlc5x4OTmjV41m4x4UheSIJqAbO3tRlO6A0ylEigw42Ez/xnYGgR7cU6DTucFQ+MnG0Z6b70f2V
 xuIGlXHsy7ZSVm0s1CxqQxs2qkCmL+USH03k/9dZUzo0eHaadNCBBICLIh1p6e5Bzv49nGFgBhoIG
 3DREhwa6Kg/WcD44ZK397kKMZFgyBB696iWVP7Fc8eEtV3LG3yAev65XCVjQnVPN/EvT5EuUAd37d
 tlVYbK3UWGuyibXN2bdRzg==;
Received: from [87.69.77.57] (port=4363 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZ99-0000yr-Al; Mon, 02 May 2022 12:43:39 -0400
Date: Mon, 02 May 2022 19:43:48 +0300
Message-Id: <8335hr6g1n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> (message from Stefan
 Monnier on Mon, 02 May 2022 12:34:28 -0400)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: larsi@HIDDEN,  mail@HIDDEN,  55205 <at> debbugs.gnu.org
> Date: Mon, 02 May 2022 12:34:28 -0400
> 
> > I have no idea.  The way you present this is waaay above my level of
> > understanding.
> >
> > Completion takes text typed by the user and produces strings that the
> > user could possibly mean by typing what he/she typed.  Some part(s) of
> > the candidates can legitimately come from what the user typed, some
> > other part(s) could be invented by the completion machinery more or
> > less out of thin air.  Why should anyone expect this meat-grinder to
> > refrain from destructively modifying any of the involved strings?
> 
> Because the overwhelming majority of strings are never modified.
> It's very unusual to modify a string by side effect (as opposed to
> creating a new string object via `concat`, `substring`, ...).
> This is true in most languages, AFAICT, but it's definitely true in
> ELisp.

I have no doubt that in most cases there's no modification of the
original strings.  However, AFAIU the discussion was about not letting
that happen, ever, and that I cannot understand.

IOW, I'm saying that people who want to see all the strings immutable,
all the time, have wrong expectations _in_principle_, even though in
most cases they will probably get what they want.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:47:02 +0000
Resent-Message-ID: <handler.55205.B55205.16515100211100 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16515100211100
          (code B ref 55205); Mon, 02 May 2022 16:47:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:47:01 +0000
Received: from localhost ([127.0.0.1]:37859 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZCP-0000Hg-CD
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:47:01 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlZCN-0000HT-Kq
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:47:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60576)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZCI-0004Cl-Bj; Mon, 02 May 2022 12:46:54 -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=5sbkTqaAjLzdOt9J9162yodkvbqXGn8C4Vv6LfsOzH0=; b=iz3/E/nfh34/
 PP28iZHyC5GfccBp4YD9zlY9g3Ghk58odfbOHZaEg7q3XiZCZxPrWj8zoENHW1ChFCVRx9keWUgNw
 x4WDDY7Assb52axt/1iG9kgesREaiD907LOzc/36ibQZ7sxtbWAMn/GBh6uO+Hu+sGuJgUbOx3sLi
 kJx1TOeEiUSFFvP//AW5NfY4muGLBHvzPFvD06AQLHU8IbR5gbfhHv6XwDLP0yiKy94lItxPnIeI+
 9NxVNfPClJ6fkV94AroOqmlVvHDt7vs0ibcY/0fuDWmDZK5xyKm2yyrArwsKzYT6iWFDwWzXQFgwx
 j60yuwOjKLzug84v2Iwk2Q==;
Received: from [87.69.77.57] (port=4570 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZCH-0001Gz-Rj; Mon, 02 May 2022 12:46:54 -0400
Date: Mon, 02 May 2022 19:47:03 +0300
Message-Id: <831qxb6fw8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <698d2a57-db2a-1c8a-5fe1-305b1c37aea2@HIDDEN> (message
 from Daniel Mendler on Mon, 2 May 2022 18:38:37 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN>
 <698d2a57-db2a-1c8a-5fe1-305b1c37aea2@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Mon, 2 May 2022 18:38:37 +0200
> Cc: larsi@HIDDEN, 55205 <at> debbugs.gnu.org
> From: Daniel Mendler <mail@HIDDEN>
> 
> One should add that *by definition* of the completion API, mutations of
> the supplied candidate strings don't take place. For example you can run
> completion on strings from the obarray:
> 
> (completing-read "Symbol: " obarray)
> 
> It would be quite harmful if the symbol names are destroyed in the
> process.

I think we have different ideas of what constitutes the "completion
API", or, more accurately, the area which you consider as "completion
API that doesn't mutate strings by definition".

> I don't see the completion API as a meat-grinder. It is all quite
> well-defined.

Many of meat-grinders I had to deal with were extremely well-defined.
There's no contradiction between the two.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:49:01 +0000
Resent-Message-ID: <handler.55205.B55205.16515101371434 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Cc: larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16515101371434
          (code B ref 55205); Mon, 02 May 2022 16:49:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:48:57 +0000
Received: from localhost ([127.0.0.1]:37863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZEG-0000N4-P8
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:48:56 -0400
Received: from server.qxqx.de ([178.63.65.180]:42507 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlZEE-0000Mn-NM
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:48:55 -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=T1UTszGOzTuHQIWl1nGhuXxJGVXVHL9AzLqS2nGViJQ=; b=oSsjawLl5Gkr9JJx4/nDE3eeBx
 RqoaIxVgOy8y607wf+4zeLeDKRWuWvtJGES+HZoletiIluUedKB/oo0P/sCO1pl/9wfzKF/JtCntx
 ItDHbmeXD6pqaxkT1VjomwheR4oZDPbZoaKGACLTSs9S3VQhtlGUjO48Z2YgkPQTELns=;
Message-ID: <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
Date: Mon, 2 May 2022 18:48:47 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <8335hr6g1n.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 18:43, Eli Zaretskii wrote:
> I have no doubt that in most cases there's no modification of the
> original strings.  However, AFAIU the discussion was about not letting
> that happen, ever, and that I cannot understand.
> 
> IOW, I'm saying that people who want to see all the strings immutable,
> all the time, have wrong expectations _in_principle_, even though in
> most cases they will probably get what they want.

I agree with you that one shouldn't have wrong expectations about
mutation of string properties in Emacs general.

But in this case, having the expectation is justified and it is also
realized throughout completion. The bug report I linked originally
essentially shows that if you use completion with a propertized string
it is not possible to restore the original text metadata by looking up
the text property, since it got destroyed in the process.

I am not only taking about the default Completions buffer UI, but also
about all kinds of other completion UIs (Icomplete and third-party
packages). These UIs all respect the immutability of completion
candidates. It is better to not weaken this contract, since it makes
things much easier to reason about.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:54:02 +0000
Resent-Message-ID: <handler.55205.B55205.16515103861833 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16515103861833
          (code B ref 55205); Mon, 02 May 2022 16:54:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:53:06 +0000
Received: from localhost ([127.0.0.1]:37868 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZII-0000TV-AO
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:53:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57520)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlZIG-0000T2-Mq
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:53:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60612)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZIA-000544-LL; Mon, 02 May 2022 12:52:58 -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=BKdj0YCiJHmgGHARJ05eTKUjbWUtTvD8Do8lDG1leWI=; b=olE0IWpqjtuS
 vIrQZdKWNCyoQHz5bOj8EzlnQLEhFofWki+qMd+vQB7puyhLoAB983W+b3P1hZatLQoFWtFRP5ftG
 WsVYJJSQUWcpEjz5agecH+xGz1A8GdAOdElrI8U3ozsDeBSbz95/IaItDV5pc97m9hjQDh9Nt53MG
 OfhZv6BbgbADCYylLB1lLJZKO/H73UxISaL/zqETXca6MD5/U2vq9faTQKhSrByLxThCjFd9GyGcn
 PoNJtiBcQo4mgCJuqNhJR0KSDqFdbijLV/s9XydpylgbZWZMsTTE3JLm4DPWjZ4ub9LK+TTJQzhzH
 GrbpSglH1qko/H0e3pfP1g==;
Received: from [87.69.77.57] (port=1146 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlZIA-0001ra-3Z; Mon, 02 May 2022 12:52:58 -0400
Date: Mon, 02 May 2022 19:53:08 +0300
Message-Id: <83zgjz511n.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN> (message
 from Daniel Mendler on Mon, 2 May 2022 18:48:47 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
 <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Mon, 2 May 2022 18:48:47 +0200
> Cc: larsi@HIDDEN, 55205 <at> debbugs.gnu.org
> From: Daniel Mendler <mail@HIDDEN>
> 
> But in this case, having the expectation is justified

Why is it justified in this case?  How is this case different from any
other case?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 16:58:01 +0000
Resent-Message-ID: <handler.55205.B55205.16515106362204 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16515106362204
          (code B ref 55205); Mon, 02 May 2022 16:58:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 16:57:16 +0000
Received: from localhost ([127.0.0.1]:37872 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlZMJ-0000ZU-Rn
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 12:57:16 -0400
Received: from server.qxqx.de ([178.63.65.180]:40759 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlZMH-0000ZD-NT
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 12:57:14 -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=IFVi4275Tl5b/ZpRAXsgEm3XXVG4hKizGApgz24bMXw=; b=QnN6GqAYWkHeQ8qQe5X14jxgNl
 Vwh3e6FAqycmTRLnz29xWI9M1YFRjOkcvoBLXar9trG+h39acHiQ7232Q/ZpDm4ul/NG9Cfprj44O
 tKj3yu5Cg5id4z8HIf9jCJUhOHy4jXcoRV76b0L5xswuyJ0b8mgchGeWMG8g2HNu+P6A=;
Message-ID: <8176b8ab-a949-6c57-3cc0-5be3bb1eb2df@HIDDEN>
Date: Mon, 2 May 2022 18:57:06 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
 <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
 <83zgjz511n.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <83zgjz511n.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 18:53, Eli Zaretskii wrote:
>> Date: Mon, 2 May 2022 18:48:47 +0200
>> Cc: larsi@HIDDEN, 55205 <at> debbugs.gnu.org
>> From: Daniel Mendler <mail@HIDDEN>
>>
>> But in this case, having the expectation is justified
> 
> Why is it justified in this case?  How is this case different from any
> other case?

I am sure that Stefan can give you a more qualified answer than I can. I
also don't see a point in this discussion. What is your argument? Do you
want to prove me wrong about the issue? The issue has been fixed
properly and satisfactorily by Stefan. If you wish, feel free to close
the issue if it hasn't been closed already.

You say that you don't have a deep understanding of the completion
machinery. Well, Stefan has. And I also claim an understanding to some
lesser extent. Why not trust these judgments?

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 17:54:02 +0000
Resent-Message-ID: <handler.55205.B55205.16515140228754 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Daniel Mendler <mail@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.16515140228754
          (code B ref 55205); Mon, 02 May 2022 17:54:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 17:53:42 +0000
Received: from localhost ([127.0.0.1]:37920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlaEw-0002H7-AI
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 13:53:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nlaEt-0002Gr-RZ
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 13:53:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33186)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlaEn-0004yy-0r; Mon, 02 May 2022 13:53:33 -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=ZIwRnY9PYcywmemPBprGm2U+F6opCSKDUUQnIi42LPw=; b=SvpdvnfsZsrx
 SKiA3htMR/AcSBgEdmY8UMgDGy6xiOcQ7eGYPnBqKmWdaS1mN/3zi6fQywNcC4mJp+WQIUCM4g6C+
 RpOseTkJ82vm4+XqNGG/jRcWfoxHQ+XNAU1a/G+iz36QB5xPCb0LnwTJflTs515phykXh2sf66KIa
 Jf4bAlJWPEUBlQrpUO7+gcOB8rIYt+YbFJWPFHuoLy9SNVudxzKrLYISSKo0EdWSTUI55WKfpT5z2
 M5fX7/85xqt9853uUBd2Au2kEDw57fEVEiQNrDjuxIcp6lWUGWgYq6uhKxkQ62xo4HXi5AyORMrg4
 yuM+4xRHsnTbbjb7nC63ww==;
Received: from [87.69.77.57] (port=4874 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nlaEm-00034A-37; Mon, 02 May 2022 13:53:32 -0400
Date: Mon, 02 May 2022 20:53:40 +0300
Message-Id: <83y1zj4y8r.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <8176b8ab-a949-6c57-3cc0-5be3bb1eb2df@HIDDEN> (message
 from Daniel Mendler on Mon, 2 May 2022 18:57:06 +0200)
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
 <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
 <83zgjz511n.fsf@HIDDEN>
 <8176b8ab-a949-6c57-3cc0-5be3bb1eb2df@HIDDEN>
X-Spam-Score: -2.3 (--)
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 (---)

> Date: Mon, 2 May 2022 18:57:06 +0200
> Cc: monnier@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
> From: Daniel Mendler <mail@HIDDEN>
> 
> > Why is it justified in this case?  How is this case different from any
> > other case?
> 
> I am sure that Stefan can give you a more qualified answer than I can. I
> also don't see a point in this discussion. What is your argument? Do you
> want to prove me wrong about the issue?

I just asked a good-faith question.  Why not answer it?

> The issue has been fixed properly and satisfactorily by Stefan. If
> you wish, feel free to close the issue if it hasn't been closed
> already.
> 
> You say that you don't have a deep understanding of the completion
> machinery. Well, Stefan has. And I also claim an understanding to some
> lesser extent. Why not trust these judgments?

That's ... rude.

I didn't start this discussion; you and others did.  Now you are in
effect saying that I'm not allowed to join it because I'm incompetent.
Not nice.

But okay, I'll bow out of this.  I have no interest in talking to
people who don't want to talk to me, let alone do it with an attitude.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Daniel Mendler <mail@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 18:37:01 +0000
Resent-Message-ID: <handler.55205.B55205.165151656813866 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165151656813866
          (code B ref 55205); Mon, 02 May 2022 18:37:01 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 18:36:08 +0000
Received: from localhost ([127.0.0.1]:38000 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nlau0-0003ba-DR
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 14:36:08 -0400
Received: from server.qxqx.de ([178.63.65.180]:41915 helo=mail.qxqx.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1nlatx-0003b1-VI
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 14:36:06 -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=OAUqPXs5MOaKH+4LkwFubgst5cYoIIghyR1DOFLbhQg=; b=G73lvCAtHjGknTvX3CIzieEHip
 6YL1sOO31XsIMjHHx4gz6jqKCVUPV1/i9D1ooG+oqIxL8WUphc7Am1ytKASjdnmzugFzJH5BezEz7
 BWsROz/HtJjfBtkVx593E9jv8Os6QEHMhWetWVfvYxU879nl6tI1E2842OlVEKzMKAaE=;
Message-ID: <337d4d1d-558e-f39b-49d7-93964b783bab@HIDDEN>
Date: Mon, 2 May 2022 20:35:56 +0200
MIME-Version: 1.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
 <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
 <83zgjz511n.fsf@HIDDEN>
 <8176b8ab-a949-6c57-3cc0-5be3bb1eb2df@HIDDEN>
 <83y1zj4y8r.fsf@HIDDEN>
From: Daniel Mendler <mail@HIDDEN>
In-Reply-To: <83y1zj4y8r.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
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 5/2/22 19:53, Eli Zaretskii wrote:
>> Date: Mon, 2 May 2022 18:57:06 +0200
>> Cc: monnier@HIDDEN, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
>> From: Daniel Mendler <mail@HIDDEN>
>>
>>> Why is it justified in this case?  How is this case different from any
>>> other case?
>>
>> I am sure that Stefan can give you a more qualified answer than I can. I
>> also don't see a point in this discussion. What is your argument? Do you
>> want to prove me wrong about the issue?
> 
> I just asked a good-faith question.  Why not answer it?

I tried to answer. Stefan tried to answer. But these answers were not
heard. Fortunately there are more answers.

Avoiding mutation in this case is helpful for performance and
efficiency. For example assume that you have many many completion
candidate strings with attached text properties (thousands of them). If
we cannot be sure that the strings are left intact, we have to copy all
these strings first before passing them to the completion system. This
will lead to a noticeable slowdown and severe unnecessary load on the
garbage collector. This really affects the UI badly and noticeably for
the user.

For illustration - in the popular Swiper package (from GNU ELPA), there
is the `swiper` command which has a noticeable startup overhead when
searching through large files, such that it essentially becomes
unusable. This startup overhead is the consequence of allocating a
string for every line of the file.

Furthermore running Swiper multiple times consecutively will lead to
significant memory usage and a garbage collector pause a short while
after. Note that Swiper is not exactly the same scenario I mentioned
above, because the strings are newly allocated. But I want to illustrate
the cost of these allocations and their impact on the UI experience.

I hope this answer is more helpful than the other earlier answers.

Daniel




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 21:08:02 +0000
Resent-Message-ID: <handler.55205.B55205.165152562223592 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: mail@HIDDEN, larsi@HIDDEN, monnier@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165152562223592
          (code B ref 55205); Mon, 02 May 2022 21:08:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 21:07:02 +0000
Received: from localhost ([127.0.0.1]:38132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nldFy-00068B-Bc
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 17:07:02 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:37681)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1nldFw-00067y-4D
 for 55205 <at> debbugs.gnu.org; Mon, 02 May 2022 17:06:56 -0400
Received: by mail-wr1-f51.google.com with SMTP id t6so21022488wra.4
 for <55205 <at> debbugs.gnu.org>; Mon, 02 May 2022 14:06:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=IVkNo9uovEqTLDwRMsEttZuBCea53qsWgaE0fYsLRts=;
 b=Jx9w9lxqZsdNiag9Z/HzQqXARmLnSCgfeCvwzzYsFYj09XpT4KtJcKdBbCMs+IUK8X
 c3I5B2X9VZJ3qeda5s7tlDLVp74kdzgGIKQU03ZRmpT5wV7hhbjiDZhWhuq6yvSbrapU
 pdkLJBFKSmEhgFGX7PQ+ExYoDw/pv+wIOQUethv5oCckRikpc7HvItkqz6ziOq9T1Uu6
 3/uYkF5RjPSjXA+xfgBlL4k18jP82C4SBKquWPXe3I2lvKcTP5K+8jusPoQo1TpRg5cN
 lOcs5D2403o4gF5edKD3rKWldjCUHZAiOXfv5yWfW411eyyfWGoMpIbhnRPHYGWSkO3I
 4kbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:from:in-reply-to
 :content-transfer-encoding;
 bh=IVkNo9uovEqTLDwRMsEttZuBCea53qsWgaE0fYsLRts=;
 b=eCLMAq1XWgHbXQ9vCH+vQr0z7Z0Y7OTGsagcHKAPRJxrCSzARqjAhlQa6HH7o11DIR
 KSUUY9k12Sx/N3Ory/zXS0chFI7l6lVe2D/rKGX+RPZbimkLyajM9nh9/5vLHHJRoixw
 cel+0h5Xou3zV9IezeS/+Q67pw/7H3KiMsSpAIRAinPQjgH2vjGCoWCZDVFL5fCDc2QH
 2uL7s9gZtipk2VTSkKCcMWObfeH6AH1e74qrJfah+QbKkyPHqR7VgQ2yAvzg2dPV+/+e
 zU0g4jmn/zgjQBiDAufnPxJhEFBUGs1aJcc6NvaTiPVmVUfIVMC6ERMaLENsjz6xLwfh
 Zq9A==
X-Gm-Message-State: AOAM533KVHB+TZQ1OP2eNXtJbQ02BGq8H6TMeUL+ynZqRgHtB4Tz1SSj
 9ofPRhNhUT/KSDSCM5qCkU0=
X-Google-Smtp-Source: ABdhPJz2GVw2UWyj0rprxYhVAwjPKKFbKlWmJ9LlCGC5gJuI8X8BC4g68umYwUF1I1J6D8aYWCoK2w==
X-Received: by 2002:a05:6000:221:b0:20a:7925:f52 with SMTP id
 l1-20020a056000022100b0020a79250f52mr10363001wrz.514.1651525610226; 
 Mon, 02 May 2022 14:06:50 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id
 z3-20020adfbbc3000000b0020c5253d8d1sm7765277wrg.29.2022.05.02.14.06.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 02 May 2022 14:06:49 -0700 (PDT)
Message-ID: <052de865-5be1-6ebb-6e1e-22b1e13d1d67@HIDDEN>
Date: Tue, 3 May 2022 00:06:47 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <a4b00546-7ca2-d1b9-4380-6e7167820471@HIDDEN> <83czgw65bl.fsf@HIDDEN>
 <27ecd6cd-3c2c-d30c-24a3-d77e0331ebf6@HIDDEN> <838rrk57sy.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <838rrk57sy.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
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.5 (/)

On 02.05.2022 17:27, Eli Zaretskii wrote:
>> Date: Mon, 2 May 2022 12:46:00 +0300
>> Cc:mail@HIDDEN,larsi@HIDDEN,monnier@HIDDEN,
>>   55205 <at> debbugs.gnu.org
>> From: Dmitry Gutov<dgutov@HIDDEN>
>>
>> On 02.05.2022 05:23, Eli Zaretskii wrote:
>>> Collection can include functions, and how do you copy that?
>> Collection can be a function, not "include functions". You fetch the
>> list of strings using that function (for the given input) and then make
>> a deep copy of that.
> So I need to call that function twice, is that it?  It is normally
> called by the completion machinery out of my control.

You only use the function at the "fetch the list" step.

How many times it is called in total, is a harder question (due to 
implementation details, sometimes suboptimal), but that number shouldn't 
have to change.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 02 May 2022 21:20:02 +0000
Resent-Message-ID: <handler.55205.B55205.165152634424884 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55205
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Daniel Mendler <mail@HIDDEN>, larsi@HIDDEN, 55205 <at> debbugs.gnu.org
Received: via spool by 55205-submit <at> debbugs.gnu.org id=B55205.165152634424884
          (code B ref 55205); Mon, 02 May 2022 21:20:02 +0000
Received: (at 55205) by debbugs.gnu.org; 2 May 2022 21:19:04 +0000
Received: from localhost ([127.0.0.1]:38192 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nldRf-0006TG-NE
	for submit <at> debbugs.gnu.org; Mon, 02 May 2022 17:19:03 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37889)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>)
 id 1nldRd-0006Sh-K0; Mon, 02 May 2022 17:19:01 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0B30E4425B3;
 Mon,  2 May 2022 17:18:56 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A28E14425AF;
 Mon,  2 May 2022 17:18:54 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1651526334;
 bh=7x1fxrbJi5J6hSSSqRxWXeXyD71G6ETvtdrxCJzOn2g=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=jbtoociekjGFY+9hZjqgU3dIZJGepr4mt4NbqF8QUo6QQgNKgwvZTjw54bpm0wNny
 V/WQGJNSHQ9iD+s2uo1uNOKcfpOSusevhS1ZiTZoUZrEMZvGIV+p1oXrlmTCyfxrk/
 ozoIyhj7YBWdH7H3ajZILWF/u8n3jRBB6igRr95co7oVVNZW9MPY07HUT6po41J0fH
 LG5c0TV6N+6QfkGscC8qaBvQO1ScdeEdJea3dnhwS+53VUWgkxQ+h6oDnuqXtCxER+
 XkKa9vLv/LLqx4C1Ly5NBsGDP/sMGN7e6ZPKm6E5eO69oM5RXHWRNEQRabXF2QiFEt
 Pe+exzMp+7Sag==
Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 93A2B120680;
 Mon,  2 May 2022 17:18:54 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvk0b3y6wk.fsf-monnier+emacs@HIDDEN>
References: <4d1b8687-20f2-137a-2739-7bba28828991@HIDDEN>
 <87wnf5mpt4.fsf@HIDDEN> <835ymp78hl.fsf@HIDDEN>
 <jwvy1zkhqpa.fsf-monnier+emacs@HIDDEN> <834k276gyd.fsf@HIDDEN>
 <jwvsfprj3qj.fsf-monnier+emacs@HIDDEN> <8335hr6g1n.fsf@HIDDEN>
 <8f18460c-269f-40fb-bc69-a9c51671899a@HIDDEN>
 <83zgjz511n.fsf@HIDDEN>
Date: Mon, 02 May 2022 17:18:47 -0400
In-Reply-To: <83zgjz511n.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 02 May
 2022 19:53:08 +0300")
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.277 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-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 (---)

Eli Zaretskii [2022-05-02 19:53:08] wrote:
> Why is it justified in this case?  How is this case different from any
> other case?

I don't think it's different from any other.  It's generally considered
a bug when a function uses things like `sort`, `nconc, or `nreverse on
a list it received as argument (unless the docstring explicitly
mentions that the arg may be modified destructively).  When a user
reports this behavior as unexpected the answer is almost always to fix
the funciton so it doesn't have this side-effect any more.

The same usually holds for text properties on strings.
The fact that `completion--replace` is a function used in the completion
machinery was largely irrelevant to the decision of how to fix
the problem.  Its docstring says:

      "Replace the buffer text between BEG and END with NEWTEXT.
    Moves point to the end of the new text."

and nowhere does it warn that NEWTEXT might be modified along the way,
so removing properties on that string was just a plain and simple bug.


        Stefan






Last modified: Mon, 2 May 2022 21:30:02 UTC

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