Subject: bug#28403: closed (Re: bug#28403: 25.2; find-tag works, but xref-find-definitions)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 11 Sep 2017 16:53:01 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
28403: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28403
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#28403: 25.2; find-tag works, but xref-find-definitions
From: Eli Zaretskii <[email-masked]>
To: Winston <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 11 Sep 2017 19:51:59 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Mon, 11 Sep 2017 01:02 EDT
> From: Winston <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> Eli asked:
> > I guess we can now close the bug report?
> 
> From my standpoint, yes.

Thanks, done.

> xref-find-definitions differs from find-tag several ways:
> * find-tag always prompted for a name, with the string at (point) as
>   the default name.  With no argument, xref-find-definitions does not
>   prompt, and tries immediately to go to a tag with that default name.
>   Use (setq xref-prompt-for-identifier t) to force prompting. 
> * find-tag allowed partial names.  xref-find-definitions does not.
>   Use TAB after a partial name in a prompt for completion(s).
> * If find-tag finds your tags OK but xref-find-definitions does not, you
>   may need to use --regexp with etags to help it identify the tag name.
>   (See etags man page.)  If even that doesn't help, try
> 							{whatever Dmitry
>   and Eli decide is a good long-term easy way to add '(tag-symbol-match-p)
>   to etags-xref-find-definitions-tag-order}.

Thanks.  Some of this is already in the documentation, other parts
will be if/when the code does what we are discussing now.

Subject: 25.2; find-tag works, but xref-find-definitions doesn't; bug?
From: Winston <[email-masked]>
To: [email-masked]
Date: Sat, 9 Sep 2017 18:40 EDT
List-Id: <debbugs-submit.debbugs.gnu.org>

[Emacs 25.2; it looks (to me) like a regexp match pattern issue in
 xref.el, not an O/S issue.]

   Today I noticed the message about find-tag being (supposedly)
obsoleted by xref-find-definitions as of Emacs version 25.1, so I tried
the new command.  Unfortunately, the new one failed completely on an
entire class of function definitions.

   After some experimenting, it appears that the problem may be that
xref-find-definitions only works when the function definition is of the
form: name spacing* '('.

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

   Changing the function definition line to

        name (type variable)

as a test, re-running etags, and reloading TAGS, xref-find-definitions
found the tag and went to it.

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