From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Benjamin Rutt Newsgroups: gmane.emacs.help Subject: Re: ancient TAGS references to deleted files remain in memory Date: Fri, 30 Apr 2004 15:21:27 -0400 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87zn8ts24o.fsf@osu.edu> References: <87hdv2tqbe.fsf@osu.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1083353812 31767 80.91.224.253 (30 Apr 2004 19:36:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Apr 2004 19:36:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 30 21:36:42 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJdoQ-0006mO-00 for ; Fri, 30 Apr 2004 21:36:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BJdkp-0007i6-GI for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Apr 2004 15:32:59 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!dhcp26143213.columbus.rr.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: dhcp26143213.columbus.rr.com (24.26.143.213) Original-X-Trace: news.uni-berlin.de 1083352888 17151026 I 24.26.143.213 ([70547]) Mail-Copies-To: nobody User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:NclHziUt7sUlUaiFlsjrz21HOJ4= Original-Xref: shelby.stanford.edu gnu.emacs.help:122878 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 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 Xref: main.gmane.org gmane.emacs.help:18166 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:18166 Benjamin Rutt writes: > I rebuild my TAGS files often (like 3 times per hour) via > > find /some/projectdir -name "*.c" -o "*.cpp" -o "*.h" > > I have two of these files in tags-table-list. By updating TAGS files > often, new methods, variables, etc. that I add in my code are > frequently picked up automatically by the time I want to visit them > with M-. or M-x tags-search. > > However, sometimes, I delete files from my project directories, yet > the TAGS file must still somehow contain some entries in memory that > reference these deleted files. I get errors like the following during > M-x tags-search: > > Opening input file: no such file or directory, /some/projectdir/STORM/quality/system/stormtestbinaryds.cpp > > where the mentioned filename is one I had deleted. FYI, I'm fixing this for now by killing all TAGS buffers before M-x tags-search is called: ;; for now, fix bug of files disappearing from TAGS files messing up ;; M-x tags-search. in the future, fix the logic in ;; `tags-verify-table' to detect files being removed. The problem is ;; that in the TAGS buffers, the buffer-local variable ;; `tags-table-files' is out of date. (defadvice tags-search (before kill-TAGS-buffers activate) (let ((active-TAGS-bufs (delq nil (mapcar (lambda (x) (if (string-match "TAGS$" (buffer-name x)) x nil)) (buffer-list))))) (mapc (lambda (x) (kill-buffer x)) active-TAGS-bufs))) When I have more time, I'll look at a better solution, maybe a patch to etags.el is needed. -- Benjamin Rutt