From 6df279065bd713c3a9b4524860631732da1519a1 Mon Sep 17 00:00:00 2001 From: David Fussner Date: Mon, 20 Mar 2023 16:57:27 +0000 Subject: [PATCH 1/2] Fix xref error when matching in unvisited files * font-latex.el (font-latex-set-syntactic-keywords): Add call to font-lock-set-defaults to fix an error when xref-find-references tries to fontify the search results in the " *xref-temp*" buffer. --- font-latex.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/font-latex.el b/font-latex.el index 8fc567e2..5adda314 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1116,9 +1116,14 @@ have changed." ;; (append font-latex-syntactic-keywords ;; ;; For docTeX comment-in-doc. ;; '(("\\(\\^\\)\\^A" (1 (font-latex-doctex-^^A)))))) - ;; Finally, compute our `syntax-propertize-function' anew. + ;; Compute our `syntax-propertize-function' anew. (setq-local syntax-propertize-function - (font-latex--make-syntax-propertize-function))) + (font-latex--make-syntax-propertize-function)) + ;; We may be using the mode programmatically to extract data, and we + ;; then need this to be set up first so that a command like + ;; `xref-find-references' doesn't bug out when matching hits in + ;; files that Emacs isn't visiting. + (font-lock-set-defaults)) ;;; Syntactic fontification -- 2.35.8