diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-08-13 11:18:40 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-08-13 11:18:40 -0400 |
commit | 3fcbcc61db31e316115364cf6275effcbfdebc6f (patch) | |
tree | bbc422fdadb3210f95a9b02fc772bad29a03318e /lisp/progmodes/js.el | |
parent | 94c10c426e305037126cf75cc5cf23c9f8df4664 (diff) | |
download | emacs-3fcbcc61db31e316115364cf6275effcbfdebc6f.tar.gz emacs-3fcbcc61db31e316115364cf6275effcbfdebc6f.tar.bz2 emacs-3fcbcc61db31e316115364cf6275effcbfdebc6f.zip |
js.el: Tweak last change
* lisp/progmodes/js.el (js-json-mode): Use a function as value of
`syntax-propertize-function`.
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r-- | lisp/progmodes/js.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index d2c24a75810..efad3b52aa9 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 |