]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-local in progmodes/*.el
authorStefan Kangas <stefan@marxist.se>
Sun, 31 Jan 2021 17:46:17 +0000 (18:46 +0100)
committerStefan Kangas <stefan@marxist.se>
Sun, 31 Jan 2021 19:08:25 +0000 (20:08 +0100)
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.

lisp/progmodes/compile.el
lisp/progmodes/cpp.el
lisp/progmodes/ebnf2ps.el
lisp/progmodes/f90.el
lisp/progmodes/gud.el
lisp/progmodes/js.el
lisp/progmodes/octave.el
lisp/progmodes/sh-script.el

index 2c1e6ff52ecc2b15aa5d23ac849ec21880573187..614ed7d835d77ee9308f50c9904fac52aacef639 100644 (file)
@@ -953,13 +953,11 @@ Faces `compilation-error-face', `compilation-warning-face',
   :type 'boolean
   :version "23.1")
 
-(defvar compilation-auto-jump-to-next nil
+(defvar-local compilation-auto-jump-to-next nil
   "If non-nil, automatically jump to the next error encountered.")
-(make-variable-buffer-local 'compilation-auto-jump-to-next)
 
-;; (defvar compilation-buffer-modtime nil
+;; (defvar-local compilation-buffer-modtime nil
 ;;   "The buffer modification time, for buffers not associated with files.")
-;; (make-variable-buffer-local 'compilation-buffer-modtime)
 
 (defvar compilation-skip-to-next-location t
   "If non-nil, skip multiple error messages for the same source location.")
@@ -1087,13 +1085,12 @@ from a different message."
             (:conc-name compilation--message->))
   loc type end-loc rule)
 
-(defvar compilation--previous-directory-cache nil
+(defvar-local compilation--previous-directory-cache nil
   "A pair (POS . RES) caching the result of previous directory search.
 Basically, this pair says that calling
    (previous-single-property-change POS \\='compilation-directory)
 returned RES, i.e. there is no change of `compilation-directory' between
 POS and RES.")
-(make-variable-buffer-local 'compilation--previous-directory-cache)
 
 (defun compilation--flush-directory-cache (start _end)
   (cond
@@ -1600,8 +1597,7 @@ to `compilation-error-regexp-alist' if RULES is nil."
                (match-beginning mn) (match-end mn)
                'font-lock-face (cadr props)))))))))
 
-(defvar compilation--parsed -1)
-(make-variable-buffer-local 'compilation--parsed)
+(defvar-local compilation--parsed -1)
 
 (defun compilation--ensure-parse (limit)
   "Make sure the text has been parsed up to LIMIT."
@@ -2673,9 +2669,8 @@ This is the value of `next-error-function' in Compilation buffers."
                             (compilation--loc->marker end-loc))
     (setf (compilation--loc->visited loc) t)))
 
-(defvar compilation-gcpro nil
+(defvar-local compilation-gcpro nil
   "Internal variable used to keep some values from being GC'd.")
-(make-variable-buffer-local 'compilation-gcpro)
 
 (defun compilation-fake-loc (marker file &optional line col)
   "Preassociate MARKER with FILE.
index 4ea1674db022d0fca506ca4cbf3b6013f079f6ab..b2c2e8dab57c7354e12f27eddb598e5a3cec0da4 100644 (file)
@@ -112,9 +112,8 @@ If nil, `cpp-progress-message' prints no progress messages."
   :group 'cpp
   :version "26.1")
 
-(defvar cpp-overlay-list nil)
-;; List of cpp overlays active in the current buffer.
-(make-variable-buffer-local 'cpp-overlay-list)
+(defvar-local cpp-overlay-list nil
+  "List of cpp overlays active in the current buffer.")
 
 (defvar cpp-callback-data)
 (defvar cpp-state-stack)
@@ -134,9 +133,8 @@ If nil, `cpp-progress-message' prints no progress messages."
 (defvar cpp-button-event nil)
 ;; This will be t in the callback for `cpp-make-button'.
 
-(defvar cpp-edit-buffer nil)
-;; Real buffer whose cpp display information we are editing.
-(make-variable-buffer-local 'cpp-edit-buffer)
+(defvar-local cpp-edit-buffer nil
+  "Real buffer whose cpp display information we are editing.")
 
 (defconst cpp-branch-list
   ;; Alist of branches.
@@ -211,9 +209,8 @@ or a cons cell (background-color . COLOR)."
 
 ;;; Parse Buffer:
 
-(defvar cpp-parse-symbols nil
+(defvar-local cpp-parse-symbols nil
   "List of cpp macros used in the local buffer.")
-(make-variable-buffer-local 'cpp-parse-symbols)
 
 (defconst cpp-parse-regexp
   ;; Regexp matching all tokens needed to find conditionals.
@@ -471,9 +468,8 @@ A prefix arg suppresses display of that buffer."
 
 
 
-(defvar cpp-edit-symbols nil)
-;; Symbols defined in the edit buffer.
-(make-variable-buffer-local 'cpp-edit-symbols)
+(defvar-local cpp-edit-symbols nil
+  "Symbols defined in the edit buffer.")
 
 (define-derived-mode cpp-edit-mode fundamental-mode "CPP Edit"
   "Major mode for editing the criteria for highlighting cpp conditionals.
index 6f9509d152be225a11dbb4bd8abf48cd20743f09..b376423c1857827f35ab64f229b837ed7baf0e54 100644 (file)
@@ -2941,16 +2941,11 @@ See `ebnf-style-database' documentation."
 (defvar ebnf-eps-executing      nil)
 (defvar ebnf-eps-header-comment nil)
 (defvar ebnf-eps-footer-comment nil)
-(defvar ebnf-eps-upper-x        0.0)
-(make-variable-buffer-local 'ebnf-eps-upper-x)
-(defvar ebnf-eps-upper-y        0.0)
-(make-variable-buffer-local 'ebnf-eps-upper-y)
-(defvar ebnf-eps-prod-width     0.0)
-(make-variable-buffer-local 'ebnf-eps-prod-width)
-(defvar ebnf-eps-max-height     0.0)
-(make-variable-buffer-local 'ebnf-eps-max-height)
-(defvar ebnf-eps-max-width      0.0)
-(make-variable-buffer-local 'ebnf-eps-max-width)
+(defvar-local ebnf-eps-upper-x        0.0)
+(defvar-local ebnf-eps-upper-y        0.0)
+(defvar-local ebnf-eps-prod-width     0.0)
+(defvar-local ebnf-eps-max-height     0.0)
+(defvar-local ebnf-eps-max-width      0.0)
 
 
 (defvar ebnf-eps-context nil
index 2641387986dcec44b955221648fe804b0a3fedee..92b165bc6418aa105e5af3f27f88707cb46995cb 100644 (file)
@@ -926,9 +926,8 @@ then the presence of the token here allows a line-break before or
 after the other character, where a break would not normally be
 allowed.  This minor issue currently only affects \"(/\" and \"/)\".")
 
-(defvar f90-cache-position nil
+(defvar-local f90-cache-position nil
   "Temporary position used to speed up region operations.")
-(make-variable-buffer-local 'f90-cache-position)
 
 \f
 ;; Hideshow support.
index 259da2fd01902abbc76721ceb7d4564719039549..eb114acdabc6ea826b9232c5f6f8b432164298f5 100644 (file)
@@ -638,8 +638,7 @@ The option \"--fullname\" must be included in this value."
 ;; receive a chunk of text which looks like it might contain the
 ;; beginning of a marker, we save it here between calls to the
 ;; filter.
-(defvar gud-marker-acc "")
-(make-variable-buffer-local 'gud-marker-acc)
+(defvar-local gud-marker-acc "")
 
 (defun gud-gdb-marker-filter (string)
   (setq gud-marker-acc (concat gud-marker-acc string))
index 33bea59e3ba9c82a621b0b8e4d77eaea8be084cd..cdf6536fc7ec852b6cfb6e46d65855df2de8caa7 100644 (file)
@@ -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.
index a14a8d75a788d5ed0840cdc4c07264020524ae78..c37bb1c7112e42a8cfaaf116c068054f7cb50bea 100644 (file)
@@ -964,8 +964,7 @@ output is passed to the filter `inferior-octave-output-digest'."
          (setq list (cdr list)))
       (set-process-filter proc filter))))
 
-(defvar inferior-octave-directory-tracker-resync nil)
-(make-variable-buffer-local 'inferior-octave-directory-tracker-resync)
+(defvar-local inferior-octave-directory-tracker-resync nil)
 
 (defun inferior-octave-directory-tracker (string)
   "Tracks `cd' commands issued to the inferior Octave process.
index fd689527676b8f84d4584615fd03a620f45fa408..f588ad99c9d0461ae79f6d903d6d53fc196acbcd 100644 (file)
@@ -541,10 +541,9 @@ sign.  See `sh-feature'."
   :group 'sh-script)
 
 
-(defvar sh-header-marker nil
+(defvar-local sh-header-marker nil
   "When non-nil is the end of header for prepending by \\[sh-execute-region].
 That command is also used for setting this variable.")
-(make-variable-buffer-local 'sh-header-marker)
 
 (defcustom sh-beginning-of-command
   "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"