GNU bug report logs - #23164
25.1.50; xref-find-definitions with local tags-file-name fails

Previous Next

Package: emacs;

Reported by: Johan Claesson <johanclaesson <at> bredband.net>

Date: Wed, 30 Mar 2016 20:54:02 UTC

Severity: normal

Found in version 25.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Johan Claesson <johanclaesson <at> bredband.net>
Cc: Óscar Fuentes <ofv <at> wanadoo.es>, 23164 <at> debbugs.gnu.org
Subject: Re: bug#23164: 25.1.50; xref-find-definitions with local
 tags-file-name fails
Date: Thu, 7 Apr 2016 06:15:19 +0300
On 04/05/2016 12:24 AM, Johan Claesson wrote:

> It also occur with other simple TAGS files that do not include other
> TAGS files.  And the TAGS file i was using when observing the problem
> the first time was this kind of simple TAGS file.

Right, thank you.

Apparently, the long-standing way to make it work is to call 
visit-tags-table with non-nil second argument, instead of just using 
setq-local. So, this seems to work correctly:

(fundamental-mode)
(visit-tags-table "~/examples/ruby/TAGS" t)
(xref-find-definitions "a")

It performs more work in advance, though, and I'm not sure what's the 
big picture with keeping variables like tags-table-list global anyway.

Here's a patch you can try that makes etags--xref-find-definitions work 
with your original scenario, but I'm not 100% sure it's good code. The 
proper solution to setting tags-file-name locally probably looks different.

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index a2a0df2..856d26b 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2111,6 +2111,7 @@ etags--xref-find-definitions
                                tags-case-fold-search
                              case-fold-search)))
     (save-excursion
+      (visit-tags-table-buffer) ; Workaround for bug#23164
       (while (visit-tags-table-buffer (not first-time))
         (setq first-time nil)
         (dolist (order-fun (cond (regexp? find-tag-regexp-tag-order)





This bug report was last modified 8 years and 170 days ago.

Previous Next


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