* Choosing tags tables
@ 2017-07-20 3:17 Daniel Lopez
2017-07-20 5:23 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Lopez @ 2017-07-20 3:17 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
After more than a decade of Emacs use I thought I'd finally try out the
tags features. I regularly code in different languages so I'm gonna need
to call on different tags tables in different buffers. And I tend to use
libraries in each of those languages so I'll want to have more than one
tags table in each search, ie. that of the utility library/libraries and
that of the project I'm working on.
So I set it up so that for example in my c++-mode-hook it sets
tags-table-list with the multiple tags files I want to use for C++; the
first is the library I use in all my C++ projects and the second is the
project-specific tags file (assuming all project sources are in the same
directory as TAGS, for now). I'm setting it as buffer-local so that it
only applies to tag searches that are started when that buffer is current:
(setq-local tags-table-list
(list "/home/daniel/docs/code/c/reusable/checkout/dan/TAGS"
(concat default-directory "TAGS")))
However when I then do a xref-find-definitions Emacs prompts me:
"Visit tags table (default TAGS):"
because (in visit-tags-table-buffer) it's not looking for the
buffer-local value of tags-table-list, only the global which is nil. If
I go along with it and enter something then Emacs sets tags-file-name to
my entry which means now I only have one tags file and my
tags-table-list gets ignored.
I alternatively tried this in my c++-mode-hook:
(visit-tags-table "/home/daniel/docs/code/c/reusable/checkout/dan/TAGS")
(visit-tags-table (concat default-directory "TAGS"))
but then whenever I open a file I get prompted about whether I want the
second one to replace the first or be appended in consideration. I don't
want to be prompted at all, I'd like to set most of this up in my init.
I might want to call up such prompts to tweak things later but it's not
likely.
Does anyone know of a better way to get this effect?
Regards,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Choosing tags tables
2017-07-20 3:17 Choosing tags tables Daniel Lopez
@ 2017-07-20 5:23 ` Eli Zaretskii
2017-07-20 9:58 ` Dmitry Gutov
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2017-07-20 5:23 UTC (permalink / raw)
To: help-gnu-emacs
> From: Daniel Lopez <daniel.lopez999@gmail.com>
> Date: Thu, 20 Jul 2017 04:17:23 +0100
>
> So I set it up so that for example in my c++-mode-hook it sets
> tags-table-list with the multiple tags files I want to use for C++; the
> first is the library I use in all my C++ projects and the second is the
> project-specific tags file (assuming all project sources are in the same
> directory as TAGS, for now). I'm setting it as buffer-local so that it
> only applies to tag searches that are started when that buffer is current:
>
> (setq-local tags-table-list
> (list "/home/daniel/docs/code/c/reusable/checkout/dan/TAGS"
> (concat default-directory "TAGS")))
>
> However when I then do a xref-find-definitions Emacs prompts me:
> "Visit tags table (default TAGS):"
> because (in visit-tags-table-buffer) it's not looking for the
> buffer-local value of tags-table-list, only the global which is nil. If
> I go along with it and enter something then Emacs sets tags-file-name to
> my entry which means now I only have one tags file and my
> tags-table-list gets ignored.
I think this should be reported as a bug, using report-emacs-bug.
In your report, please provide more details about your conclusion that
visit-tags-table-buffer ignores buffer-local values: AFAICT, that
function does have provisions for considering local values, so it
could be that xref-find-definitions fails to invoke some functions
correctly or with the right buffer being the current one. A Lisp
backtrace at the time visit-tags-table-buffer could help.
Also, a minimal test case to reproduce the problem will be useful.
> Does anyone know of a better way to get this effect?
The way you tried first should "just work".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Choosing tags tables
2017-07-20 5:23 ` Eli Zaretskii
@ 2017-07-20 9:58 ` Dmitry Gutov
2017-07-20 10:32 ` Eli Zaretskii
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2017-07-20 9:58 UTC (permalink / raw)
To: Eli Zaretskii, help-gnu-emacs
On 7/20/17 8:23 AM, Eli Zaretskii wrote:
> The way you tried first should "just work".
Only in master, right? Maybe Daniel is trying a release version of Emacs.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Choosing tags tables
2017-07-20 9:58 ` Dmitry Gutov
@ 2017-07-20 10:32 ` Eli Zaretskii
2017-07-20 13:42 ` Daniel Lopez
0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2017-07-20 10:32 UTC (permalink / raw)
To: help-gnu-emacs
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Thu, 20 Jul 2017 12:58:07 +0300
>
> On 7/20/17 8:23 AM, Eli Zaretskii wrote:
>
> > The way you tried first should "just work".
>
> Only in master, right?
Maybe, I'm not sure. That's why I asked for a simple reproducer.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Choosing tags tables
2017-07-20 10:32 ` Eli Zaretskii
@ 2017-07-20 13:42 ` Daniel Lopez
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lopez @ 2017-07-20 13:42 UTC (permalink / raw)
To: help-gnu-emacs
On 20/07/17 11:32, Eli Zaretskii wrote:
>> From: Dmitry Gutov <dgutov@yandex.ru>
>> Date: Thu, 20 Jul 2017 12:58:07 +0300
>>
>> On 7/20/17 8:23 AM, Eli Zaretskii wrote:
>>
>>> The way you tried first should "just work".
>>
>> Only in master, right?
>
> Maybe, I'm not sure. That's why I asked for a simple reproducer.
>
>
It's true, I'm using the current release version according to Arch Linux
which is 25.2.
I'll post a reproducer shortly to bug-gnu-emacs@gnu.org.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-20 13:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 3:17 Choosing tags tables Daniel Lopez
2017-07-20 5:23 ` Eli Zaretskii
2017-07-20 9:58 ` Dmitry Gutov
2017-07-20 10:32 ` Eli Zaretskii
2017-07-20 13:42 ` Daniel Lopez
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.