From: Konstantin Kharlamov Date: Thu, 30 Jan 2025 14:09:48 +0000 (+0300) Subject: Avoid infinite questions if TAGS file was removed X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=09f85e59ffce6b33953f49ee72b03cc4a5eeb8a6;p=emacs.git 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) (cherry picked from commit eb12b6d153b8ad3f9e3fe23761a98021d8071293) --- diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 950afeb080e..f025b649402 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -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.