(fileloop-next-file novisit)
(switch-to-buffer (current-buffer)))
+(defun etags--ensure-file (file)
+ "Ensure FILE can be visited.
+
+FILE should be an expanded file name.
+This function tries to locate FILE, possibly adding it a suffix
+present in `tags-compression-info-list'. If the file can't be found,
+signals an error.
+Else, returns the filename that can be visited for sure."
+ (let ((f (locate-file file nil (if auto-compression-mode
+ tags-compression-info-list
+ '("")))))
+ (unless f
+ (signal 'file-missing (list "Cannot locate file in TAGS" file)))
+ f))
+
(defun tags--all-files ()
(save-excursion
(let ((cbuf (current-buffer))
;; list later returned by (tags-table-files).
(setf (if tail (cdr tail) files)
(mapcar #'expand-file-name (tags-table-files)))))
- files)))
+ (mapcar #'etags--ensure-file files))))
(make-obsolete-variable 'tags-loop-operate 'fileloop-initialize "27.1")
(defvar tags-loop-operate nil
(beginning-of-line)
(pcase-let* ((tag-info (etags-snarf-tag))
(`(,hint ,line . _) tag-info))
- (let* ((file (file-of-tag))
+ (let* ((file (etags--ensure-file (file-of-tag)))
(mark-key (cons file line)))
(unless (gethash mark-key marks)
(let ((loc (xref-make-etags-location