GNU bug report logs - #61283
29.0.60; pcomplete-completions-at-point loses text properties, breaking pcomplete-from-help annotations

Previous Next

Package: emacs;

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

Date: Sun, 5 Feb 2023 00:24:01 UTC

Severity: normal

Merged with 65844

Found in versions 29.0.60, 30.0.50

Full log


Message #29 received at 61283 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Daniel Mendler <mail <at> daniel-mendler.de>, Eli Zaretskii <eliz <at> gnu.org>
Cc: liuhui1610 <at> gmail.com, monnier <at> iro.umontreal.ca, 61283 <at> debbugs.gnu.org
Subject: Re: bug#61283: 29.0.60; pcomplete-completions-at-point loses text
 properties, breaking pcomplete-from-help annotations
Date: Tue, 16 May 2023 22:45:42 -0700
On 5/16/2023 3:44 AM, Daniel Mendler wrote:
> I just tried again and it seems the annotations work only in Shell but
> not in Eshell. This is probably the reason why the issue was missed. In
> Eshell the functionality never worked as intended after it got
> installed. I didn't mean to exaggerate.
> 
> - M-x shell -> Type ls - TAB -> Annotations are displayed
> - M-x eshell -> Type ls - TAB -> No annotations

I don't see annotations in either shell or eshell. Am I doing something 
wrong? From "emacs -Q -f shell", I type "ls -" and press TAB.

I do have a mostly-complete patch for this though, but it's *certainly* 
too complex for Emacs 29. The general strategy I'm using is to rely on 
the fact that the completion list for 'try-completion', etc can be an 
alist where the "keys" (i.e the CAR of each element of the main list) 
are the strings to be completed. So then you can do something like:

  '(("foo" (pcomplete-annotation . "=bar"))
    ;; ...
    )

Then, in 'pcomplete-completions-at-point', I can get the annotations[1] 
in the :annotation-function on the completion table that we return.

This is obviously a pretty invasive change and would require changing a 
number of internal assumptions in Pcomplete (though I don't think it 
would break the public API). If this sounds even remotely like a 
reasonable way to go forward, I'll try to clean up my patch a bit more 
and post it for feedback; it's currently a bit of a mess, I'm afraid...

[1] Ditto for 'pcomplete-help' and the :company-docsig function.




This bug report was last modified 1 year and 278 days ago.

Previous Next


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