Subject: bug#28403: 25.2; find-tag works, but xref-find-definitions doesn't; bug?

From: Dmitry Gutov <[email-masked]>
Date: Sun, 10 Sep 2017 02:10:02 +0300

On 9/10/17 1:39 AM, Winston wrote:

>     The C code in question uses macros around function arguments in its
> definitions.  E.g.,
> 
>          name _ARGS1(type,variable)
> 
>     find-tag (and etags) work just fine with that, and such function
> definition lines appear in the TAGS file (as they should), but
> xref-find-definitions fails to find such function tags, saying instead
> "No definitions found for: name".

Which program are you generating TAGS with? Is it etags that comes with 
Emacs? xref-find-definitions is somewhat stricter about its input than 
find-tag.

What does the entry for this function inside TAGS look like? You can 
paste it into the reply. The TAGS format is close to plain text.

I'm guessing it looks like:

name _ARGS1(

which is an "implicit tag name" entry for "_ARGS1", but not for "name". 
IOW, etags doesn't understand macros.

>     So, xref-find-definitions is not yet a complete replacement for
> find-tag.  Since etags puts such lines in TAGS and xref-find-definitions
> is unable to match up the name with the tag, it looks like a bug /
> deficiency in xref-find-definitions.

Try adding `tag-symbol-match-p' to 
etags-xref-find-definitions-tag-order. This example should work then, 
but you'll get more false positives (like treating return types as 
function names).