* ancient TAGS references to deleted files remain in memory
@ 2004-04-29 21:41 Benjamin Rutt
2004-04-30 19:21 ` Benjamin Rutt
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Rutt @ 2004-04-29 21:41 UTC (permalink / raw)
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.
I know I can restart my emacs to get rid of these warnings, but I like
to leave emacs running for at least a week if not a month. I've also
tried M-x tags-reset-tags-tables followed by M-x visit-tags-table to a
newly built TAGS file but that doesn't help either. Is there any
other solution to this problem other than restarting emacs?
--
Benjamin Rutt
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ancient TAGS references to deleted files remain in memory
2004-04-29 21:41 ancient TAGS references to deleted files remain in memory Benjamin Rutt
@ 2004-04-30 19:21 ` Benjamin Rutt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Rutt @ 2004-04-30 19:21 UTC (permalink / raw)
Benjamin Rutt <rutt.4+news@osu.edu> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-04-30 19:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-29 21:41 ancient TAGS references to deleted files remain in memory Benjamin Rutt
2004-04-30 19:21 ` Benjamin Rutt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).