From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#23164: 25.1.50; xref-find-definitions with local tags-file-name fails Date: Thu, 7 Apr 2016 06:15:19 +0300 Message-ID: <0cbc0981-a763-39f4-89da-ea955cae3a71@yandex.ru> References: <87egar3czt.fsf@bredband.net> <87a497cc-15b1-504b-fd4a-8fb3e484e507@yandex.ru> <87zita16ow.fsf@wanadoo.es> <87vb3xm5z3.fsf@bredband.net> <87r3elm5j4.fsf@bredband.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1459998981 4935 80.91.229.3 (7 Apr 2016 03:16:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2016 03:16:21 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar?= Fuentes , 23164@debbugs.gnu.org To: Johan Claesson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 05:16:11 2016 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 1ao0QV-0002Ap-9w for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Apr 2016 05:16:11 +0200 Original-Received: from localhost ([::1]:47306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao0QU-0007Oo-LD for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Apr 2016 23:16:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao0QR-0007Oi-NH for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2016 23:16:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ao0QM-0002IY-MY for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2016 23:16:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39972) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ao0QM-0002IU-I8 for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2016 23:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ao0QM-00051U-8f for bug-gnu-emacs@gnu.org; Wed, 06 Apr 2016 23:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Apr 2016 03:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23164 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23164-submit@debbugs.gnu.org id=B23164.145999892819263 (code B ref 23164); Thu, 07 Apr 2016 03:16:02 +0000 Original-Received: (at 23164) by debbugs.gnu.org; 7 Apr 2016 03:15:28 +0000 Original-Received: from localhost ([127.0.0.1]:52309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ao0Po-00050d-9l for submit@debbugs.gnu.org; Wed, 06 Apr 2016 23:15:28 -0400 Original-Received: from mail-wm0-f47.google.com ([74.125.82.47]:34328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ao0Pn-00050R-Dg for 23164@debbugs.gnu.org; Wed, 06 Apr 2016 23:15:27 -0400 Original-Received: by mail-wm0-f47.google.com with SMTP id l6so7015715wml.1 for <23164@debbugs.gnu.org>; Wed, 06 Apr 2016 20:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=te0pE4n1yda1Ybw5mydr5CvFJk6l/0QyABWb6g/1eNc=; b=CX8Nfaj4u+jUnZfDHhAUGFQZAEmKlMiFVgbl0sPXZWspkseoJU9P9Zx1edhuftS80I 2BdmT0H1m7c9wodJK54KCrm5neteKy0n33u9A6zrnUpzNhx0MCh6j0aC8/2EBmnlR2m6 0GN1D1KepefJy3BO5eL4gDn+Vovq+U1k4HncTUoBxUcHgVwN6Sw4A2PwVHKoJrUNDtS5 FGnHnWD28Jy/hNC4JWT3GwtAa7UtFkXkt01gUpTSSq2coNzS6gUKJqiteFaIAenerZ/j Dt4SZ1I6HfgULYNJGliz3D8GSiIgVq6GXdGufpoWmAemPS6IOraKJ6sjUVAWAyrUD4/Q b3ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=te0pE4n1yda1Ybw5mydr5CvFJk6l/0QyABWb6g/1eNc=; b=jE0ujLl6jc+A67yIKrVctnG0hMzrHNpJS8fWEdeMFO8o5UhVMi9eNsaY8R5PMyVeoZ vh8REJ7BqaFasAT3YzSN6fIiumF+qLRQK55gyjdhv58lyZPtUlZubjWwglog4KqH6Lys 5mordSroY/A8GzuZMnKE6qpdIK64VW9afgTRfFEZND3ufpb2pHxQYocCThg5O/56jnNf sr77zRVN2xyBlIxv2A2X/mWA2kx6PtQT9HsmC2IqUrJt2+B4jnWS+wcpmWaZosRKfaTQ u56pRiKLQQ3n0SciZ2A9U0WqNwexSMevzM/pIsG4tj20OFYqWOYse+ygcmQXQdjUmk0g P6FA== X-Gm-Message-State: AD7BkJKDZFScIvmTDbksDzHfivlUjmkE7JP78FeSGFQXaxubQjEKJ2+Nr+B4Nx/X2PRWWQ== X-Received: by 10.194.111.229 with SMTP id il5mr775224wjb.82.1459998921777; Wed, 06 Apr 2016 20:15:21 -0700 (PDT) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id p189sm27940165wmb.7.2016.04.06.20.15.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2016 20:15:21 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 In-Reply-To: <87r3elm5j4.fsf@bredband.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:116148 Archived-At: 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)