unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Select Tags Table in a Single Buffer
@ 2013-02-02 23:18 Josiah Schwab
  2013-02-04  6:01 ` Filipp Gunbin
  0 siblings, 1 reply; 2+ messages in thread
From: Josiah Schwab @ 2013-02-02 23:18 UTC (permalink / raw)
  To: help-gnu-emacs

Hi All,

I want to select the tags table in a single buffer in a way such that
there is no effect on any other buffers.

The motivation for this is that I am writing simple buffer-local
minor-mode.  As part of it, I want to have a specific tags file
loaded/unloaded when the minor-mode is toggled (on/off).

I'm not particularly experienced with either elisp or tags, but I read
the Emacs tags documentation and looked at etags.el (in v24.2).

At first blush, it seemed like this would be straightforward by using
the local argument to visit-tags-table.

(visit-tags-table my-tags-file-name t)

Indeed, this sets a buffer-local value of tags-file-name.  However,
tags-table-list is global, so the behavior of tags in all other
buffers is affected by this action.

Is anyone aware of a way to achieve the (lack of) effect that I was
hoping to have?

Best,
Josiah



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Select Tags Table in a Single Buffer
  2013-02-02 23:18 Select Tags Table in a Single Buffer Josiah Schwab
@ 2013-02-04  6:01 ` Filipp Gunbin
  0 siblings, 0 replies; 2+ messages in thread
From: Filipp Gunbin @ 2013-02-04  6:01 UTC (permalink / raw)
  To: Josiah Schwab; +Cc: help-gnu-emacs

On 03/02/2013 03:18 +0400, Josiah Schwab wrote:

> Hi All,
>
> I want to select the tags table in a single buffer in a way such that
> there is no effect on any other buffers.
>
> The motivation for this is that I am writing simple buffer-local
> minor-mode.  As part of it, I want to have a specific tags file
> loaded/unloaded when the minor-mode is toggled (on/off).
>
> I'm not particularly experienced with either elisp or tags, but I read
> the Emacs tags documentation and looked at etags.el (in v24.2).
>
> At first blush, it seemed like this would be straightforward by using
> the local argument to visit-tags-table.
>
> (visit-tags-table my-tags-file-name t)
>
> Indeed, this sets a buffer-local value of tags-file-name.  However,
> tags-table-list is global, so the behavior of tags in all other
> buffers is affected by this action.
>
> Is anyone aware of a way to achieve the (lack of) effect that I was
> hoping to have?
>
> Best,
> Josiah

`(make-local-variable 'tags-table-list)' will help hopefully. But there
probably are other variables which are not buffer-local and which could
get into your way, so I'd check all variables that etags module uses.

Also, see (info "(emacs) Locals").

-- 
Filipp Gunbin



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-04  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02 23:18 Select Tags Table in a Single Buffer Josiah Schwab
2013-02-04  6:01 ` Filipp Gunbin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).