[Top][All Lists]

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

Re: a smarter find-tag that reruns etags and makes another try

From: Kim F. Storm
Subject: Re: a smarter find-tag that reruns etags and makes another try
Date: 15 Mar 2002 16:26:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

[This thread started in gnu.emacs.sources].

Järneström Jonas <address@hidden> writes:

> Luis Fernandes wanted a mechanism that could cope with any language
> files.
> (previous posting could only handle elisp files)
> Maybe this can satisfy Luis?

Maybe, but this indicates that it would be sensible for etags to store
the command line options/switches in the tags file, so it would be
easy to rerun it with the exact same options.  And it can get the
list of files to rerun etags on from the TAGS file as well.

And then we could enhance find-tag to do this.

However, it should ask the user before refreshing the TAGS file.
I'm working on projects with 1000+ files, so a simple typo shouldn't
cause an automatic rebuild.

> ---------------------------------------------------------------
> (defadvice find-tag (around refresh-etags activate)
>   "Rerun etags and reload tags if tag not found and redo find-tag."
>   (let ((extension (file-name-extension (buffer-file-name))))
>   (condition-case err
>       ad-do-it
>     (error (er-refresh-etags extension) ad-do-it))))
> (defun er-refresh-etags (&optional extension)
>   "Run etags on all peer files in current dir and reload them silently."
>   (interactive)
>   (shell-command (format "etags *.%s" (or extension "el")))
>   (setq tags-revert-without-query t)  ; don't ask
>   (visit-tags-table default-directory nil))

Kim F. Storm  http://www.cua.dk

reply via email to

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