GNU bug report logs - #78489
30.1.50; Using etags, Ada and xref-find-definitions doesn't find definitions

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Mon, 19 May 2025 01:39:02 UTC

Severity: normal

Found in version 30.1.50

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Troy Brown <brownts <at> troybrown.dev>, 78489 <at> debbugs.gnu.org
Subject: Re: bug#78489: 30.1.50; Using etags, Ada and xref-find-definitions
 doesn't find definitions
Date: Tue, 27 May 2025 10:00:29 -0400
>> procedure Hello_World is
>>    procedure Display_Message is
>>    begin
>>       Put_Line ("Hello, World!");
>>    end Display_Message;
>> begin  -- Hello_World
>>    Display_Message/p
>> end Hello_World;
>> --8<---------------cut here---------------end--------------->8---
>> 
>> As you can see above the "/p" suffix is added into the buffer as part
>> of the completion.  This is not valid syntax.  I must therefore delete
>> "/p" before adding the final semicolon.  This is what my suggested fix
>> was attempting to address...preventing the insertion of the invalid
>> suffix into the buffer.
>
> "M-x completion-at-point" is a separate command, so this is basically
> a separate issue, unrelated to our switch to Xref.  Trying this
> command in Emacs 24.4, I see that it inserts "Display_Message/p" in
> that version as well.  While I agree with you that it isn't
> user-friendly to insert the "/p" part, I'm not sure the fix should be
> in etags-tags-completion-table, because that function is called (via
> tags-completion-table-function) in more than just this scenario, and
> we could break some of those other scenarios.
>
> Maybe Ada source files should have their own specialized value for
> completion-at-point-functions?
>
> Stefan, WDYT?

I haven't had time to look closely, but IIUC those `/p` aren't
reallypart of the completed names but only some meta-info about their
nature, so it sounds like a job for `:annotation-function` (in
`completion-at-point-function`) or `annotation-function` (in the
completion table's metadata).


        Sefan





This bug report was last modified 55 days ago.

Previous Next


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