GNU bug report logs - #19466
25.0.50; xref-find-def doesn't find C functions

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Mon, 29 Dec 2014 19:28:02 UTC

Severity: normal

Found in version 25.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 19466 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19466 <at> debbugs.gnu.org
Subject: Re: bug#19466: 25.0.50; xref-find-def doesn't find C functions
Date: Tue, 30 Dec 2014 22:43:55 +0200
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.




This bug report was last modified 10 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.