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#21443: 24.5; etags' complete-tag changes the global value of tags-file-name Date: Tue, 24 Nov 2015 00:03:12 +0200 Message-ID: <56538D20.9090106@yandex.ru> References: <935A139E-4ED1-468D-9B23-CD0999D296F8@me.com> <83pp1q3xic.fsf@gnu.org> <4b3df5cb.21a.14fbb06425d.Coremail.mohu3g@163.com> <83lhcd4f4n.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1448316274 27099 80.91.229.3 (23 Nov 2015 22:04:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Nov 2015 22:04:34 +0000 (UTC) Cc: 21443@debbugs.gnu.org To: Eli Zaretskii , HGY Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 23 23:04:18 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 1a0zDb-0004yX-LU for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Nov 2015 23:04:15 +0100 Original-Received: from localhost ([::1]:34860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0zDc-0003JM-IQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Nov 2015 17:04:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0zDT-0003BJ-OX for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2015 17:04:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0zDO-0001EW-Ki for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2015 17:04:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0zDO-0001ES-IQ for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2015 17:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a0zDO-0002mm-A5 for bug-gnu-emacs@gnu.org; Mon, 23 Nov 2015 17:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Nov 2015 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21443 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21443-submit@debbugs.gnu.org id=B21443.144831619910645 (code B ref 21443); Mon, 23 Nov 2015 22:04:02 +0000 Original-Received: (at 21443) by debbugs.gnu.org; 23 Nov 2015 22:03:19 +0000 Original-Received: from localhost ([127.0.0.1]:49963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0zCg-0002lc-Hw for submit@debbugs.gnu.org; Mon, 23 Nov 2015 17:03:18 -0500 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:34139) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0zCe-0002lU-Mw for 21443@debbugs.gnu.org; Mon, 23 Nov 2015 17:03:17 -0500 Original-Received: by wmvv187 with SMTP id v187so182334735wmv.1 for <21443@debbugs.gnu.org>; Mon, 23 Nov 2015 14:03:15 -0800 (PST) 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-type:content-transfer-encoding; bh=SKQBMK7rsDBt4wtaG8I4EHFenBq7Nwfz5WlB0K7Ostw=; b=K7Fne8HXL997twX0VJTsHuaeZv16uMAuI1nZQOlzrdlLQIisq9iYAFm+PlSY8rM7GB F9yClQuR4SjtZ3L+4vww19oENj1AsOzzn2J/7Dg+7utAknVr6vvnN7zvOK2iImqA8NjA Qtohk1fh8blB3/w+pJgNO449/wyLERI/MlmopPwJhGrrTYqs9WUkVDd4eXhYZhdXNXja uKw4NSFWmtXcgNonJr0d4/4t5QWniLCTnnv0MQel+CrnUwC9UteGrAVRu14siXeCXEj+ /LuHz6EIwN5LfRZ3SvNJKFpcWP5pJ2FIRPf5lZ/8KgCCDor930+wE0GjmXvPdOeU2+20 lAPw== X-Received: by 10.28.4.7 with SMTP id 7mr20467822wme.85.1448316195826; Mon, 23 Nov 2015 14:03:15 -0800 (PST) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id n127sm15098664wmf.12.2015.11.23.14.03.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 14:03:14 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 In-Reply-To: <83lhcd4f4n.fsf@gnu.org> 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: 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:109155 Archived-At: On 09/11/2015 09:57 AM, Eli Zaretskii wrote: > You can't, currently. You need to invoke visit-tags-table manually, > with a prefix argument, before the mini-buffer completion. This is > how the code was designed. Unfortunately, this is also broken: you can C-u M-x visit-tags-table, and it will set the local value of tags-file-name, but as soon as you M-x find-tag, it changes the global value of tags-file-name as well, to the last element in tags-table-list. Apparently because the lambda in tags-lazy-completion-table calls visit-tags-table-buffer at least twice, and the latter function modifies tags-file-name, _and_ changes the current buffer (and when called the second time, it changes tags-file-name in the tags table buffer, thus changing the global value). And I can't simply wrap most of the second half of visit-tags-table-buffer in a with-current-buffer, because some code assumes that the buffer does indeed change. Otherwise, the value of tags-completion-table-function is nil (tags-completion-table calls it after calling visit-tags-table-buffer). Modifications of tags-file-name are also numerous, so changing a couple of setq to setq-local inside visit-tags-table-buffer doesn't do the trick either. At this point I'm leaving this to someone else who's more motivated. But we'll likely already migrate to e.g. GNU Global before that happens.