From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates Date: Mon, 2 May 2022 12:17:53 +0200 Message-ID: <0ecea0f0-45ac-f5bd-91b6-07d713540264@daniel-mendler.de> References: <4d1b8687-20f2-137a-2739-7bba28828991@daniel-mendler.de> <87wnf5mpt4.fsf@gnus.org> <87k0b5duzh.fsf@gnus.org> <8735htdrmt.fsf@gnus.org> <87o80g486l.fsf@gnus.org> <552469c2-d4d3-3caa-016a-a454f3e53779@daniel-mendler.de> <878rrk2qow.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30675"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , 55205@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 02 12:19:16 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlT99-0007o0-Th for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 May 2022 12:19:15 +0200 Original-Received: from localhost ([::1]:49712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlT98-0003JX-BW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 May 2022 06:19:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlT8w-0003JO-6n for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 06:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlT8v-0004VJ-TY for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 06:19:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlT8v-0007gb-Oi for bug-gnu-emacs@gnu.org; Mon, 02 May 2022 06:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 May 2022 10:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55205 X-GNU-PR-Package: emacs Original-Received: via spool by 55205-submit@debbugs.gnu.org id=B55205.165148668329469 (code B ref 55205); Mon, 02 May 2022 10:19:01 +0000 Original-Received: (at 55205) by debbugs.gnu.org; 2 May 2022 10:18:03 +0000 Original-Received: from localhost ([127.0.0.1]:34942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlT7y-0007fF-NH for submit@debbugs.gnu.org; Mon, 02 May 2022 06:18:02 -0400 Original-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 ) id 1nlT7w-0007ej-Mz for 55205@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=; Content-Language: en-US In-Reply-To: <878rrk2qow.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231252 Archived-At: On 5/2/22 12:07, Lars Ingebrigtsen wrote: > Daniel Mendler 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