summaryrefslogtreecommitdiff
path: root/lisp/progmodes/js.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-01-31 18:46:17 +0100
committerStefan Kangas <stefan@marxist.se>2021-01-31 20:08:25 +0100
commit59e8c37d61d313335408f8f23e3025b499200266 (patch)
tree512045e9795a406f53cf479212ada9a1d4bfd135 /lisp/progmodes/js.el
parent458faaf4c39936a5e7d187684cbf0fe0b161bb0a (diff)
downloademacs-59e8c37d61d313335408f8f23e3025b499200266.tar.gz
emacs-59e8c37d61d313335408f8f23e3025b499200266.tar.bz2
emacs-59e8c37d61d313335408f8f23e3025b499200266.zip
Prefer defvar-local in progmodes/*.el
This skips libraries that might want compatibility with Emacs 24.2. * lisp/progmodes/compile.el (compilation-auto-jump-to-next) (compilation--previous-directory-cache, compilation--parsed) (compilation-gcpro): * lisp/progmodes/cpp.el (cpp-overlay-list, cpp-edit-buffer) (cpp-parse-symbols, cpp-edit-symbols): * lisp/progmodes/ebnf2ps.el (ebnf-eps-upper-x, ebnf-eps-upper-y) (ebnf-eps-prod-width, ebnf-eps-max-height, ebnf-eps-max-width): * lisp/progmodes/f90.el (f90-cache-position): * lisp/progmodes/gud.el (gud-marker-acc): * lisp/progmodes/js.el (js--quick-match-re) (js--quick-match-re-func, js--cache-end, js--last-parse-pos) (js--state-at-last-parse-pos, js--tmp-location): * lisp/progmodes/octave.el (inferior-octave-directory-tracker-resync): * lisp/progmodes/sh-script.el (sh-header-marker): Prefer defvar-local.
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r--lisp/progmodes/js.el19
1 files changed, 6 insertions, 13 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 33bea59e3ba..cdf6536fc7e 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -717,26 +717,20 @@ This variable is like `sgml-attribute-offset'."
table)
"Syntax table for `js-mode'.")
-(defvar js--quick-match-re nil
+(defvar-local js--quick-match-re nil
"Autogenerated regexp used by `js-mode' to match buffer constructs.")
-(defvar js--quick-match-re-func nil
+(defvar-local js--quick-match-re-func nil
"Autogenerated regexp used by `js-mode' to match constructs and functions.")
-(make-variable-buffer-local 'js--quick-match-re)
-(make-variable-buffer-local 'js--quick-match-re-func)
-
-(defvar js--cache-end 1
+(defvar-local js--cache-end 1
"Last valid buffer position for the `js-mode' function cache.")
-(make-variable-buffer-local 'js--cache-end)
-(defvar js--last-parse-pos nil
+(defvar-local js--last-parse-pos nil
"Latest parse position reached by `js--ensure-cache'.")
-(make-variable-buffer-local 'js--last-parse-pos)
-(defvar js--state-at-last-parse-pos nil
+(defvar-local js--state-at-last-parse-pos nil
"Parse state at `js--last-parse-pos'.")
-(make-variable-buffer-local 'js--state-at-last-parse-pos)
(defun js--maybe-join (prefix separator suffix &rest list)
"Helper function for `js--update-quick-match-re'.
@@ -1505,8 +1499,7 @@ REGEXPS, but only if FRAMEWORK is in `js-enabled-frameworks'."
(when (memq (quote ,framework) js-enabled-frameworks)
(re-search-forward ,regexps limit t)))))
-(defvar js--tmp-location nil)
-(make-variable-buffer-local 'js--tmp-location)
+(defvar-local js--tmp-location nil)
(defun js--forward-destructuring-spec (&optional func)
"Move forward over a JavaScript destructuring spec.