From 59e8c37d61d313335408f8f23e3025b499200266 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 31 Jan 2021 18:46:17 +0100 Subject: 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. --- lisp/progmodes/compile.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'lisp/progmodes/compile.el') diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 2c1e6ff52ec..614ed7d835d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -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. -- cgit v1.2.3