GNU bug report logs -
#55205
28.1.50; completion--replace illegally mutates completion candidates
Previous Next
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
On 5/2/22 12:07, Lars Ingebrigtsen wrote:
> Daniel Mendler <mail <at> daniel-mendler.de> 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
This bug report was last modified 231 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.