(with-current-buffer buffer
(revert-buffer t t)))
(if (not (and new novisit))
- (find-file next novisit)
+ (find-file next)
;; Like find-file, but avoids random warning messages.
(switch-to-buffer (get-buffer-create " *next-file*"))
(kill-all-local-variables)
"No \\[tags-search] or \\[tags-query-replace] in progress"))
"Form for `tags-loop-continue' to eval to scan one file.
If it returns non-nil, this file needs processing by evalling
-\`tags-loop-operate'. Otherwise, move on to the next file.")
+`tags-loop-operate'. Otherwise, move on to the next file.")
(defun tags-loop-eval (form)
"Evaluate FORM and return its result.
;; Now operate on the file.
;; If value is non-nil, continue to scan the next file.
- (tags-loop-eval tags-loop-operate))
+ (save-restriction
+ (widen)
+ (tags-loop-eval tags-loop-operate)))
(setq file-finished t))
(and messaged
(null tags-loop-operate)
(defun etags-xref-find (action id)
(pcase action
(`definitions (etags--xref-find-definitions id))
- (`references
- (etags--xref-find-matches id #'xref-collect-references))
- (`matches
- (etags--xref-find-matches id #'xref-collect-matches))
+ (`references (etags--xref-find-references id))
(`apropos (etags--xref-find-definitions id t))))
-(defun etags--xref-find-matches (input fun)
- (let ((dirs (if tags-table-list
- (mapcar #'file-name-directory tags-table-list)
- ;; If no tags files are loaded, prompt for the dir.
- (list (read-directory-name "In directory: " nil nil t)))))
- (cl-mapcan (lambda (dir) (funcall fun input dir)) dirs)))
+(defun etags--xref-find-references (symbol)
+ ;; TODO: Merge together with the Elisp impl.
+ (cl-mapcan
+ (lambda (dir)
+ (xref-collect-references symbol dir))
+ (project-search-path (project-current))))
(defun etags--xref-find-definitions (pattern &optional regexp?)
;; This emulates the behaviour of `find-tag-in-order' but instead of
(with-slots (tag-info) l
(nth 1 tag-info)))
+(defun etags-search-path ()
+ (mapcar #'file-name-directory tags-table-list))
+
\f
(provide 'etags)