[Top][All Lists]

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

Re: finding tags files based on location

From: Kevin Rodgers
Subject: Re: finding tags files based on location
Date: Mon, 25 Feb 2008 21:08:15 -0700
User-agent: Thunderbird (Macintosh/20071031)

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)

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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