emacs-devel
[Top][All Lists]
Advanced

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

Re: auto-refresh TAGS file on ChangeLog mod?


From: Tom Tromey
Subject: Re: auto-refresh TAGS file on ChangeLog mod?
Date: Fri, 22 Aug 2008 09:43:14 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Tom> I've wanted to roll the retags idea into etags itself.  It could read
Tom> a ".retags" file, daemonize, and use inotify to watch for changes in a
Tom> directory tree.  I never found the time to do it though.

Ted> I'd like the solution to be implemented in Emacs, not externally.

Why is that?

My first attempt was done that way.  But, given that etags is already
external to emacs, I reasoned that it doesn't buy much to go this
route.

Ted> Emacs doesn't have inotify facilities AFAIK

Nope.  FWIW, retags actually uses the inotify-tools package.  This is
just a couple of little inotify wrappers that are handy for shell
scripts; Emacs can use them just as easily.  But, as you say, adding
inotify support to Emacs would also not be difficult.

Ted> New files of interest can probably be inferred by building a list of
Ted> extensions in TAGS; if you have .c files already then you'll want new.c
Ted> as well.  I think anything more than this should require manual
Ted> reindexing or some user configuration of "I want to tag all *.c files."

Right, this is where the .retags file comes in.  It tells retags what
to do.  The particular use case that I needed here was "don't index
anything in testsuite/".  I definitely do not want new .c files in
testsuite showing up...

This project is easy if you have a simple source tree, or a small one.
I'm more interested in the weird cases, because the programs I work on
are large and all have odd cases -- files I don't want to index,
unknown file types that require regex tags, etc.

In this spirit of overdoing it, I made retags notice when .retags is
modified, and then apply any changes :)

Ted> Remembering the original list of files is not needed, right?  Can you
Ted> just run "etags --append new_or_updated_files"?  I think it's OK to have
Ted> outdated (deleted) entries in TAGS until a full rescan is done by the
Ted> user; I can't think of any other problems with this.

I have a patch somewhere that makes 'etags -u' work for emacs-style
tags files.  I can send that if you want.

Tom




reply via email to

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