From: Dmitry Gutov Date: Thu, 9 May 2024 02:57:07 +0000 (+0300) Subject: xref--collect-matches: Fix the application of syntax-propertize X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a84ce9d1d610f4c0722baa39847836f30e2be1d7;p=emacs.git xref--collect-matches: Fix the application of syntax-propertize * lisp/progmodes/xref.el (xref--collect-matches): Add syntax-ppss-flush-cache call when needed (bug#53749). (cherry picked from commit 86187d43e2db841f8ca2893a31f05669f4a1247b) --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a9c42313f12..9e489e52755 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2241,6 +2241,8 @@ Such as the current syntax table and the applied syntax properties." (pcase-let* ((`(,line ,file ,text) hit) (file (and file (concat xref--hits-remote-id file))) (buf (xref--find-file-buffer file)) + ;; This is fairly dangerouns, but improves performance + ;; for large lists, see https://debbugs.gnu.org/53749#227 (inhibit-modification-hooks t)) (if buf (with-current-buffer buf @@ -2272,6 +2274,8 @@ Such as the current syntax table and the applied syntax properties." (erase-buffer)) (insert text) (goto-char (point-min)) + (when syntax-needed + (syntax-ppss-flush-cache (point))) (xref--collect-matches-1 regexp file line (point) (point-max)