emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3fcbcc61db: js.el: Tweak last change


From: Stefan Monnier
Subject: master 3fcbcc61db: js.el: Tweak last change
Date: Sat, 13 Aug 2022 11:18:49 -0400 (EDT)

branch: master
commit 3fcbcc61db31e316115364cf6275effcbfdebc6f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    js.el: Tweak last change
    
    * lisp/progmodes/js.el (js-json-mode): Use a function as value of
    `syntax-propertize-function`.
---
 lisp/progmodes/js.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index d2c24a7581..efad3b52aa 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3490,9 +3490,10 @@ This function is intended for use in 
`after-change-functions'."
 
 ;;;###autoload
 (define-derived-mode js-json-mode js-mode "JSON"
-  ;; JSON files can be big.  Speed up syntax-ppss.
-  (setq-local syntax-propertize-function nil)
-  (setq-local js-enabled-frameworks nil))
+  (setq-local js-enabled-frameworks nil)
+  ;; Speed up `syntax-ppss': JSON files can be big but can't hold
+  ;; regexp matchers nor #! thingies (and `js-enabled-frameworks' is nil).
+  (setq-local syntax-propertize-function #'ignore))
 
 ;; Since we made JSX support available and automatically-enabled in
 ;; the base `js-mode' (for ease of use), now `js-jsx-mode' simply



reply via email to

[Prev in Thread] Current Thread [Next in Thread]