]> git.eshelyaron.com Git - emacs.git/commitdiff
js.el: Tweak last change
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 13 Aug 2022 15:18:40 +0000 (11:18 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 13 Aug 2022 15:18:40 +0000 (11:18 -0400)
* lisp/progmodes/js.el (js-json-mode): Use a function as value of
`syntax-propertize-function`.

lisp/progmodes/js.el

index d2c24a75810a943075cf8a02db63f642f0c74866..efad3b52aa9f0a5808aad72aaf677da7d9838edb 100644 (file)
@@ -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