]> git.eshelyaron.com Git - emacs.git/commitdiff
xref--collect-matches: Fix the application of syntax-propertize
authorDmitry Gutov <dmitry@gutov.dev>
Thu, 9 May 2024 02:57:07 +0000 (05:57 +0300)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 13:33:22 +0000 (15:33 +0200)
* lisp/progmodes/xref.el (xref--collect-matches):
Add syntax-ppss-flush-cache call when needed (bug#53749).

(cherry picked from commit 86187d43e2db841f8ca2893a31f05669f4a1247b)

lisp/progmodes/xref.el

index a9c42313f1213248126510e16d84f684e1300a2e..9e489e52755ab4a72ed49bcea7155534fec58015 100644 (file)
@@ -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)