GNU bug report logs - #55205
28.1.50; completion--replace illegally mutates completion candidates

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 1 May 2022 08:29:02 UTC

Severity: normal

Found in version 28.1.50

Done: Daniel Mendler <mail <at> daniel-mendler.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: larsi <at> gnus.org, 55205 <at> debbugs.gnu.org
Subject: bug#55205: 28.1.50; completion--replace illegally mutates completion candidates
Date: Mon, 2 May 2022 18:48:47 +0200
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




This bug report was last modified 232 days ago.

Previous Next


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