Avoid infinite questions if TAGS file was removed

When the visited TAGS file was removed, commands that depend on
TAGS, such as auto-completion, may invoke an interactive question
whether a user wants to re-read the file.  From that point on,
the question will be asked over and over, because the file no
longer exists, which results in mtime mismatch and inability to
"fix the mismatch" by reading from the file.  Fix that by simply
ignoring the mismatch if the file no longer exists.
* lisp/progmodes/etags.el (tags-verify-table): Avoid infinite
questions if TAGS file was removed.  (Bug#75946)
This commit is contained in:
Konstantin Kharlamov 2025-01-30 17:09:48 +03:00 committed by Eli Zaretskii
parent 532ff6e29d
commit eb12b6d153

View file

@ -445,6 +445,9 @@ Returns non-nil if it is a valid table."
(set-buffer (get-file-buffer file))
(or verify-tags-table-function (tags-table-mode))
(unless (or (verify-visited-file-modtime (current-buffer))
;; Avoid an infinte loop of questions about
;; re-reading content if file was removed.
(not (file-exists-p file))
;; Decide whether to revert the file.
;; revert-without-query can say to revert
;; or the user can say to revert.