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

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

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


From: Eli Zaretskii
Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions
Date: Tue, 30 Dec 2014 17:31:46 +0200

> Date: Tue, 30 Dec 2014 06:57:49 +0200
> From: Dmitry Gutov <dgutov@yandex.ru>
> 
> 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?

I did it in *scratch*.  But *scratch*'s major mode is not
emacs-lisp-mode, it's lisp-interaction-mode.  I think the difference
is significant for the purposes of this discussion.

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

Isn't it possible to _prefer_ the symbols that are consistent with the
major mode, but not entirely discard the other possible candidates?

In a mixed-language project such as Emacs, these subtle conditions
that completely conceal symbols depending on the current mode, make
very little sense to me.  (And there are other mixed-language projects
out there, like Guile, GDB, etc.)  The Emacs TAGS tables traditionally
included tags from lisp/ files in src/TAGS, and for a very good
reason.

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

I assume that this new facility is an improvement, so I _want_ to use
it.  Especially since NEWS says:

  ** etags
  As a result of the above, these commands are now obsolete:
  `find-tag-other-window', `find-tag-other-frame', `find-tag-regexp',
  `tags-apropos' and `tags-loop-continue'.

Considering something obsolete means that a replacement is available
that is as good or better than the replaced feature.  I don't want to
go back to obsolete commands, unless I really have to, i.e. unless I
find the situation with xref unbearable.  I hope we are not there yet.

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

See above: out src/TAGS includes lisp/TAGS.  We do this for a long
time, and it's a tremendously useful thing when working on Emacs
development.





reply via email to

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