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: Dmitry Gutov
Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions
Date: Tue, 30 Dec 2014 22:43:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Thunderbird/33.0

On 12/30/2014 05:31 PM, Eli Zaretskii wrote:

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.

I wouldn't say it is (lisp-interaction-mode inherits from emacs-lisp-mode). And if we consider the scratch vs any .el file in the Emacs sources, it's less natural to use tags in scratch because it's conceptually farther from emacs/src/TAGS.

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?

Sure, but that has to be written in a sensible manner, too. Emacs core still has no notion of projects (or even moreso, project types), so it's harder to say "also use etags when in the Emacs sources".

Not all projects use etags, and this is almost never true in third-party Lisp projects, such as ELPA packages.

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.

So if you're fine with tags, do you at all need the specialized navigation provided by emacs-lisp-mode? Like suggested, you could undo the changes made by emacs-lisp-mode to xref-* variables in emacs-lisp-mode-hook. A couple of `kill-local-variable' would suffice.

But personally, I'd never choose tags over find-func, and it's not a good default for the many users and third-party developers out there.

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.

Let's hope so.





reply via email to

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