emacs-devel
[Top][All Lists]
Advanced

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

Re: Generation of tags for the current project on the fly


From: Tom Tromey
Subject: Re: Generation of tags for the current project on the fly
Date: Mon, 29 Jan 2018 22:05:06 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

>>>>> "Dmitry" == Dmitry Gutov <address@hidden> writes:

Dmitry> Speaking of deletions, this is not strictly necessary (we could just
Dmitry> delete the whole TAGS and recreate), but it would be helpful if, when
Dmitry> passed a non-existing file that is in TAGS, 'etags -u' deleted it from
Dmitry> the index. Right now, it only complains "No such file or directory",
Dmitry> but keeps it in the index.

Could you try the appended?  It worked locally for me.

Tom

diff --git a/lib-src/etags.c b/lib-src/etags.c
index 925355f9da..d6eda19be6 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -1942,7 +1942,15 @@ process_file_name (char *file, language *lang)
       if (! inf)
        {
          errno = file_errno;
-         perror (file);
+
+         if (update && errno == ENOENT)
+           {
+             /* Add the filename to the hash but don't do anything else.  This
+                will result in the entry being removed from the tags file.  */
+             add_filename_to_hash (file);
+           }
+         else
+           perror (file);
          goto cleanup;
        }
     }



reply via email to

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