From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions Date: Fri, 23 Jan 2015 23:34:05 +0200 Message-ID: <83oapprxki.fsf@gnu.org> References: <8361cucl3u.fsf@gnu.org> <54A6DAF6.5070605@yandex.ru> <831tna9tmr.fsf@gnu.org> <54A9C94F.8040701@yandex.ru> <83vbkl99vm.fsf@gnu.org> <54B8878A.4050506@yandex.ru> <54B8C22B.3080200@gmx.at> <54BC7A77.5020307@yandex.ru> <54BCC033.2010104@gmx.at> <83oapuy8ew.fsf@gnu.org> <54BDC34C.5070309@yandex.ru> <83wq4hwejl.fsf@gnu.org> <54BEBF63.9050709@yandex.ru> <8361c0w16n.fsf@gnu.org> <54C063E3.8020401@yandex.ru> <83a91avglz.fsf@gnu.org> <54C1655E.4050403@yandex.ru> <83r3uluawd.fsf@gnu.org> <54C28635.8070606@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422048913 10569 80.91.229.3 (23 Jan 2015 21:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2015 21:35:13 +0000 (UTC) Cc: 19466@debbugs.gnu.org, eller.helmut@gmail.com, dgutov@yandex.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 23 22:35:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YElsl-0000Xu-Ao for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jan 2015 22:35:11 +0100 Original-Received: from localhost ([::1]:33235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElsk-0002fG-Mh for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jan 2015 16:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElsg-0002e2-JV for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2015 16:35:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YElsd-0005pU-9s for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2015 16:35:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElsd-0005oj-3n for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2015 16:35:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YElsc-0006ov-Ot for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2015 16:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jan 2015 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19466 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19466-submit@debbugs.gnu.org id=B19466.142204885326150 (code B ref 19466); Fri, 23 Jan 2015 21:35:02 +0000 Original-Received: (at 19466) by debbugs.gnu.org; 23 Jan 2015 21:34:13 +0000 Original-Received: from localhost ([127.0.0.1]:54642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YElro-0006nh-Oe for submit@debbugs.gnu.org; Fri, 23 Jan 2015 16:34:13 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:49727) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YElrl-0006nT-UR for 19466@debbugs.gnu.org; Fri, 23 Jan 2015 16:34:11 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NIN00700FQNYT00@mtaout29.012.net.il> for 19466@debbugs.gnu.org; Fri, 23 Jan 2015 23:30:38 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NIN00M41FR2QO80@mtaout29.012.net.il>; Fri, 23 Jan 2015 23:30:38 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98657 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , eller.helmut@gmail.com, 19466@debbugs.gnu.org > Date: Fri, 23 Jan 2015 16:15:49 -0500 > > >> 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. It does (try "M-x visit-tags-table" and you will see that the default it suggests is like you say). It just doesn't automatically load TAGS, because the fact that I am in some buffer doesn't yet mean that I'm working on that buffer's project and need its TAGS. > 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. The important part is that it allows me to keep or discard portions of the tags table. _That_ is certainly NOT 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-. So you are saying that when I'm in some buffer, I cannot look at some of the identifiers until I switch to another buffer? That's very inconvenient. Again, when I work on a problem that happens between a program and a library, I need to see both sides of the interface at the same time, independently of which buffer I am in. Conceptually, the set of identifiers that are relevant to me in this situation is the union of both projects, and I should be able to find any identifier from this union no matter which buffer is the current one.