help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finding tags files based on location


From: gamename
Subject: Re: finding tags files based on location
Date: Tue, 26 Feb 2008 11:01:05 -0800 (PST)
User-agent: G2/1.0

On Feb 25, 8:08 pm, Kevin Rodgers <kevin.d.rodg...@gmail.com> wrote:
> gamename wrote:
> > I often have to checkout multiple copies of the same source tree from
> > cvs.  For example, if I have a source tree 'foo' in cvs, I may have 2
> > copies like ~/foo0/bar and ~/foo1/bar in my home directory at the same
> > time.  Each copy of the foo tree will have a tags file in 'foo/tags'.
>
> > Does anyone have code that will enable emacs to determine which tags
> > file to use based on the tree i'm currently using?  For example, if
> > I'm in foo1/bar, I would be using the tags file in foo1/tags, not foo0/
> > tags.  Is there code to dynamically determine that?
>
> Is it enough to make tags-file-name a buffer local variable, set
> appropriately for each file?  If so:
>
> (defun set-local-tags-file-name ()
>    (when (file-exists-p "tags")
>      (set (make-local-variable 'tags-file-name)
>          (expand-file-name "tags"))))
>
> (add-hook 'find-file-hook 'set-local-tags-file-name)

Thanks Kevin, but I don't think that scales very well.  If I have
thousands of files, that wouldn't be workable.
-T



reply via email to

[Prev in Thread] Current Thread [Next in Thread]