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

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

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


From: Dmitry Gutov
Subject: bug#28403: 25.2; find-tag works, but xref-find-definitions doesn't; bug?
Date: Sun, 10 Sep 2017 02:10:02 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0

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).





reply via email to

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