bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61283: 29.0.60; pcomplete-completions-at-point loses text properties


From: Jim Porter
Subject: bug#61283: 29.0.60; pcomplete-completions-at-point loses text properties, breaking pcomplete-from-help annotations
Date: Mon, 22 May 2023 21:16:59 -0700

On 5/18/2023 6:30 AM, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
... since getting a 100% reliable solution here might take quite a bit more
work than I thought, how about a not-quite-100% hack? Instead of
propertizing the first character of each candidate, propertize the *last*
character (or the entire string?). That won't get thrown out quite
so easily.

I'll see your "last char" and raise you a "the whole string" (and then
use the property on the first char where it's found, using
`next-single-property-change`)?

After thinking this over some more, how about a completely different strategy like the following? This uses a programmed completion function[1] to supply an annotation-function as appropriate.

This also fixes a tangentially-related issue where long options that take an argument added an extraneous space after the trailing "=". (This bit is actually the original patch I was working on before discovering the issue described in this bug.)

Pcomplete might have some issues with handling programmed completion functions like this, but I *think* it makes sense to go this route if possible: making Pcomplete work more like the rest of Emacs' completion code would be very nice.

[1] "Programmed completion" vs "programmable completion (Pcomplete)": *that's* definitely not confusing at all. ;)

Attachment: 0001-WIP-Use-a-programmed-completion-function-to-handle-l.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]