[Top][All Lists]

[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: Stefan Monnier
Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions
Date: Fri, 23 Jan 2015 16:15:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> If xref can reliably deduce that I switched projects and automatically
>> update its database, that's fine with me, and would probably
>> constitute what you mean by "dependence on the current file or
>> project".

Right, ideally that's what tags.el should do: it should associate
a "file-system area" to each TAGS file; so it can know automatically
which TAGS file to use based on default-directory.

Whether it then keeps several TAGS file opened at the same time, or
whether it only keeps a single-one-at-a-time (and reloads the other
when you move to a buffer that belongs to a different project) is just
an implementation detail.

>> Take, for example, the use case where I'm testing a program and found
>> a bug.  I then need to be able to quickly find and examine the
>> definition of symbols that might be involved in the bug, look at their
>> code, perhaps make some changes -- this all will be served well by
>> using the database (such as TAGS) of that single program.  But suppose
>> I now come to the conclusion that the bug is not in the program per
>> se, but involves one of the external libraries it uses.  Now I need to
>> go through the sources of that library (whose sources, by sheer luck
>> or maybe something else, I already have available on my system).  How
>> would xref or etags know whether I switched to that library as part of
>> my previous work (and therefore still need access to the previous
>> project's symbols), or because I'm now working on an entirely
>> different project?

It wouldn't and it would only give you access to the identifiers of the
project to which the current-buffer belongs.  So if you use M-. from
a file in the buggy library it's use the TAGS file of that library, and
if you then go to a different buffer belonging to your program and use
M-. xref should then use the TAGS file of that program.  I.e. you tell
Emacs which TAGS file to use by selecting an appropriate buffer before
you hit M-.


reply via email to

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