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: Wed, 4 May 2022 10:51:14 +0200 Message-ID: References: <4d1b8687-20f2-137a-2739-7bba28828991@daniel-mendler.de> <87wnf5mpt4.fsf@gnus.org> <87k0b5duzh.fsf@gnus.org> <8735htdrmt.fsf@gnus.org> <87wnf49ww8.fsf@gnus.org> <87k0b2zzxr.fsf@gnus.org> <8735hpwxeg.fsf@gnus.org> <5b168c65-415f-0f7e-74da-c3c7bcb8dd3b@daniel-mendler.de> 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="22147"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 55205@debbugs.gnu.org To: Lars Ingebrigtsen , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 04 10:52:18 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 1nmAk4-0005T5-OR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 May 2022 10:52:16 +0200 Original-Received: from localhost ([::1]:35926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmAk3-0006ww-C8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 May 2022 04:52:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmAjq-0006ui-JE for bug-gnu-emacs@gnu.org; Wed, 04 May 2022 04:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nmAjq-00055A-6o for bug-gnu-emacs@gnu.org; Wed, 04 May 2022 04:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nmAjq-0002VG-1z for bug-gnu-emacs@gnu.org; Wed, 04 May 2022 04:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 May 2022 08:52:02 +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.16516542849574 (code B ref 55205); Wed, 04 May 2022 08:52:02 +0000 Original-Received: (at 55205) by debbugs.gnu.org; 4 May 2022 08:51:24 +0000 Original-Received: from localhost ([127.0.0.1]:41752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmAjD-0002UM-Vo for submit@debbugs.gnu.org; Wed, 04 May 2022 04:51:24 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:45587 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nmAjC-0002U9-H3 for 55205@debbugs.gnu.org; Wed, 04 May 2022 04:51:23 -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=c60xFqSnSbgLi/V9/6kk402PFbdg6HcDKFUuHecFXfU=; b=jeS5FxLUcoEHYvMm2+plJdqkCs R4qJOgYOnf5TOkxcQUyKWFPxUAU/72M9wnR6TbImYbBPwnZjn9+IiUkePjThPU31E3oYy9PbFPRK1 EHKmpcCAGNNoN9luvWp736Od2esbNQ0nlZSl44Cq+dRuUzp0dse116GimVYhb999e+3s=; Content-Language: en-US In-Reply-To: <5b168c65-415f-0f7e-74da-c3c7bcb8dd3b@daniel-mendler.de> 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:231380 Archived-At: On 5/4/22 10:24, Daniel Mendler wrote: > > > On 5/4/22 09:48, Lars Ingebrigtsen wrote: >> Stefan Monnier writes: >> >>>> But I still have no idea why we're stripping text properties in the >>>> first place, so could you please explain that? >>> >>> It depends where. In `completion--replace` it's explained in the >>> comment: >>> >>> ;; The properties on `newtext' include things like the >>> ;; `completions-first-difference' face, which we don't want to >>> ;; include upon insertion. >> >> So it's really about stripping modifications that completion has already >> done to the strings? Well, that seems like an easy enough problem to >> deal with -- just remove those, and leave the rest of the text >> properties alone. > > I don't understand where the discussion is going. The bug has been fixed > by copying the string, ensuring that any original candidate string stays > unchanged. Just stripping the properties which were supposedly added by > completion is not a good solution since the original candidate string > could already come with exactly these properties. I think my last mail missed the point. `completion--replace` is supposed to strip *all properties* since we are inserting the completed text in the destination buffer. At this point the inserted/replaced text is to be treated like user input and shouldn't carry any text properties, neither text properties produced by completion, nor text properties which were attached originally to the candidate strings. Daniel