From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: auto-refresh TAGS file on ChangeLog mod? Date: Thu, 21 Aug 2008 10:31:26 -0600 Message-ID: References: <86iqtyxuqc.fsf@lifelogs.com> <86tzde8oc6.fsf@lifelogs.com> Reply-To: Tom Tromey NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219337332 6803 80.91.229.12 (21 Aug 2008 16:48:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2008 16:48:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 21 18:49:43 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KWDLI-00027s-0u for ged-emacs-devel@m.gmane.org; Thu, 21 Aug 2008 18:49:07 +0200 Original-Received: from localhost ([127.0.0.1]:56336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWDK6-00006q-KN for ged-emacs-devel@m.gmane.org; Thu, 21 Aug 2008 12:47:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWD4P-0003oE-Qk for emacs-devel@gnu.org; Thu, 21 Aug 2008 12:31:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWD4O-0003nF-3N for emacs-devel@gnu.org; Thu, 21 Aug 2008 12:31:33 -0400 Original-Received: from [199.232.76.173] (port=37168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWD4N-0003n6-W0 for emacs-devel@gnu.org; Thu, 21 Aug 2008 12:31:32 -0400 Original-Received: from mx1.redhat.com ([66.187.233.31]:46538) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWD4N-0006zd-I7 for emacs-devel@gnu.org; Thu, 21 Aug 2008 12:31:31 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m7LGVMPV002698; Thu, 21 Aug 2008 12:31:23 -0400 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7LGVMks019138; Thu, 21 Aug 2008 12:31:22 -0400 Original-Received: from opsy.redhat.com (vpn-10-87.bos.redhat.com [10.16.10.87]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7LGVIsv006506; Thu, 21 Aug 2008 12:31:18 -0400 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id 720D837828E; Thu, 21 Aug 2008 10:31:26 -0600 (MDT) X-Attribution: Tom In-Reply-To: <86tzde8oc6.fsf@lifelogs.com> (Ted Zlatanov's message of "Thu\, 21 Aug 2008 08\:55\:21 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102783 Archived-At: >>>>> "Ted" == Ted Zlatanov writes: Ted> On Mon, 18 Aug 2008 09:28:59 -0500 Ted Zlatanov wrote: TZ> I'm curious if there's a way to auto-run etags in a directory when I run TZ> `find-tag' if the ChangeLog file (or any other file I specify) is newer TZ> than the TAGS file. In Makefile format, this is simply Ted> I got no answers on gnu.emacs.help. Maybe someone on emacs-devel will Ted> have an idea. I tried to solve this problem a couple times. Actually, I tried to solve the more general problem of auto-updating TAGS in response to any change, not just a change to some sentinel file. Once I wrote a big patch to put the etags command-line arguments into the TAGS file, so you could reliably re-run etags when a file was saved. This never went in; in the end I think it is not the best approach, since it doesn't handle changes occurring outside of Emacs, and it doesn't have a way to handle new files. My next approach was a "retags" script. This uses inotify to watch for file changes, then re-runs etags. It uses a simple ".retags" file to decide how to invoke etags -- this solves the "new file" problem. I can send retags to you if you want. I posted it to emacs-sources once. It is pretty slow, especially the first time it starts. That is the main reason I don't use it. I've wanted to roll the retags idea into etags itself. It could read a ".retags" file, daemonize, and use inotify to watch for changes in a directory tree. I never found the time to do it though. Tom