From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.help Subject: Re: best practices for TAGS Date: Tue, 06 Dec 2011 03:20:25 +0100 Message-ID: <87ehwi785y.fsf@nzebook.haselwarter.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1323138052 10705 80.91.229.12 (6 Dec 2011 02:20:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 02:20:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 06 03:20:49 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXkeG-0005im-3c for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Dec 2011 03:20:48 +0100 Original-Received: from localhost ([::1]:33075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXkeF-0007V8-E6 for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Dec 2011 21:20:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXkeA-0007Uy-Ec for help-gnu-emacs@gnu.org; Mon, 05 Dec 2011 21:20:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXke9-000168-Eu for help-gnu-emacs@gnu.org; Mon, 05 Dec 2011 21:20:42 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:52841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXke9-000164-8S for help-gnu-emacs@gnu.org; Mon, 05 Dec 2011 21:20:41 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RXke6-0005fD-Vd for help-gnu-emacs@gnu.org; Tue, 06 Dec 2011 03:20:38 +0100 Original-Received: from 62.116.113.78.rev.sfr.net ([78.113.116.62]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Dec 2011 03:20:38 +0100 Original-Received: from philipp.haselwarter by 62.116.113.78.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Dec 2011 03:20:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 62.116.113.78.rev.sfr.net X-NSA-Fodder: Pine Gap Lon Horiuchi ASO Security Council Kh-11 White Water X-Drdoom-Fodder: crypt satan security root crash passwd User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:fIjERK3qR2Lfmt8qM+Ygs42XFO8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83138 Archived-At: I'd make a buffer local variable for the tags file name on your `cc-mode-hook' or something suitable, using for example (let ((dir (locate-dominating-file default-directory "TAGS"))) (if dir (set (make-local-variable 'my-local-tags-fn) (expand-file-name "TAGS" dir)) (message "TAGS not found"))) then call etags on your after-save-hook if the variable is set (if (bound-and-true-p my-buffer-local-tags-filename) (start-process "regen-TAGS" nil "etags.emacs" "-o" my-buffer-local-tags-filename "-a" (buffer-file-name))) -- Philipp Haselwarter