GNU bug report logs -
#21443
24.5; etags' complete-tag changes the global value of tags-file-name
Previous Next
Reported by: HuangMario <guiyang.huang <at> me.com>
Date: Wed, 9 Sep 2015 15:40:02 UTC
Severity: normal
Merged with 17326
Found in versions 24.3.90, 24.5
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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.
This bug report was last modified 8 years and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.