Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions

From: Dmitry Gutov <[email-masked]>
Date: Tue, 30 Dec 2014 06:57:49 +0200

On 12/29/2014 09:27 PM, Eli Zaretskii wrote:
> Run "make TAGS" in the top-level directory, then:
>
>   emacs -Q
>   Click menu-bar->Edit->Go To->Set Tags File Name
>   Navigate to src/TAGS and select it in the file selection dialog
>   Click menu-bar->Edit->Go To->Find Definition
>   Type "display_line RET" at the prompt
>   => [No match]

Are you doing that in e.g. emacs-lisp-mode buffer? Naturally, it 
wouldn't work, because that major mode defines its own identifier 
completion table and find-definition function.

I understand what you're trying to do, but don't see a way to achieve 
that while keeping the uniform interface for the user in different major 
modes (which can use different navigation logic).

> The above does work if I invoke the same sequence from a buffer
> visiting xdisp.c (or any other file from src/),

Or buffer in any major mode that doesn't define its own navigation function.

 > but that sounds like
> an inconvenience.  The old tags feature didn't require that.

Suggestions welcome, but maybe you should just keep using `find-tag'. 
The generic navigation commands are more useful to have as the menu 
items, though.

Alternatively, you could reset `xref-find-function' and 
`xref-identifier-completion-table-function' to their default values in 
`emacs-lisp-mode-hook'. That could be a decent choice if your TAGS file 
includes the lisp files as well.