Prefer setq-local in emacs-lisp/*.el
* lisp/emacs-lisp/chart.el (chart-mode): * lisp/emacs-lisp/copyright.el (copyright-update): * lisp/emacs-lisp/eieio-custom.el (eieio-customize-object): * lisp/emacs-lisp/elint.el (elint-update-env, elint-init-form): * lisp/emacs-lisp/ert.el (ert--results-update-ewoc-hf): (ert--setup-results-buffer): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): * lisp/emacs-lisp/pp.el (pp-display-expression): * lisp/emacs-lisp/re-builder.el (reb-mode, reb-restart-font-lock): * lisp/emacs-lisp/shadow.el (load-path-shadows-mode): * lisp/emacs-lisp/smie.el (smie-setup): * lisp/emacs-lisp/syntax.el (syntax-propertize): * lisp/emacs-lisp/trace.el (trace-make-advice): Prefer setq-local.
This commit is contained in:
parent
f0db9ae213
commit
81fe928a76
12 changed files with 32 additions and 36 deletions
|
|
@ -120,7 +120,7 @@ too much in text characters anyways.")
|
||||||
(define-derived-mode chart-mode special-mode "Chart"
|
(define-derived-mode chart-mode special-mode "Chart"
|
||||||
"Define a mode in Emacs for displaying a chart."
|
"Define a mode in Emacs for displaying a chart."
|
||||||
(buffer-disable-undo)
|
(buffer-disable-undo)
|
||||||
(set (make-local-variable 'font-lock-global-modes) nil)
|
(setq-local font-lock-global-modes nil)
|
||||||
(font-lock-mode -1) ;Isn't it off already? --Stef
|
(font-lock-mode -1) ;Isn't it off already? --Stef
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ interactively."
|
||||||
(match-string-no-properties 1)
|
(match-string-no-properties 1)
|
||||||
copyright-current-gpl-version)))))
|
copyright-current-gpl-version)))))
|
||||||
(replace-match copyright-current-gpl-version t t nil 1))))
|
(replace-match copyright-current-gpl-version t t nil 1))))
|
||||||
(set (make-local-variable 'copyright-update) nil)))
|
(setq-local copyright-update nil)))
|
||||||
;; If a write-file-hook returns non-nil, the file is presumed to be written.
|
;; If a write-file-hook returns non-nil, the file is presumed to be written.
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -365,8 +365,7 @@ These groups are specified with the `:group' slot flag."
|
||||||
(widget-insert "\n\n")
|
(widget-insert "\n\n")
|
||||||
(widget-insert "Edit object " (eieio-object-name obj) "\n\n")
|
(widget-insert "Edit object " (eieio-object-name obj) "\n\n")
|
||||||
;; Create the widget editing the object.
|
;; Create the widget editing the object.
|
||||||
(make-local-variable 'eieio-wo)
|
(setq-local eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
|
||||||
(setq eieio-wo (eieio-custom-widget-insert obj :eieio-group g))
|
|
||||||
;;Now generate the apply buttons
|
;;Now generate the apply buttons
|
||||||
(widget-insert "\n")
|
(widget-insert "\n")
|
||||||
(eieio-custom-object-apply-reset obj)
|
(eieio-custom-object-apply-reset obj)
|
||||||
|
|
@ -375,10 +374,8 @@ These groups are specified with the `:group' slot flag."
|
||||||
;;(widget-minor-mode)
|
;;(widget-minor-mode)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(widget-forward 3)
|
(widget-forward 3)
|
||||||
(make-local-variable 'eieio-co)
|
(setq-local eieio-co obj)
|
||||||
(setq eieio-co obj)
|
(setq-local eieio-cog g)))
|
||||||
(make-local-variable 'eieio-cog)
|
|
||||||
(setq eieio-cog g)))
|
|
||||||
|
|
||||||
(cl-defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass))
|
(cl-defmethod eieio-custom-object-apply-reset ((_obj eieio-default-superclass))
|
||||||
"Insert an Apply and Reset button into the object editor.
|
"Insert an Apply and Reset button into the object editor.
|
||||||
|
|
|
||||||
|
|
@ -355,15 +355,14 @@ Returns the forms."
|
||||||
;; Env is up to date
|
;; Env is up to date
|
||||||
elint-buffer-forms
|
elint-buffer-forms
|
||||||
;; Remake env
|
;; Remake env
|
||||||
(set (make-local-variable 'elint-buffer-forms) (elint-get-top-forms))
|
(setq-local elint-buffer-forms (elint-get-top-forms))
|
||||||
(set (make-local-variable 'elint-features) nil)
|
(setq-local elint-features nil)
|
||||||
(set (make-local-variable 'elint-buffer-env)
|
(setq-local elint-buffer-env (elint-init-env elint-buffer-forms))
|
||||||
(elint-init-env elint-buffer-forms))
|
|
||||||
(if elint-preloaded-env
|
(if elint-preloaded-env
|
||||||
;; FIXME: This doesn't do anything! Should we setq the result to
|
;; FIXME: This doesn't do anything! Should we setq the result to
|
||||||
;; elint-buffer-env?
|
;; elint-buffer-env?
|
||||||
(elint-env-add-env elint-preloaded-env elint-buffer-env))
|
(elint-env-add-env elint-preloaded-env elint-buffer-env))
|
||||||
(set (make-local-variable 'elint-last-env-time) (buffer-modified-tick))
|
(setq-local elint-last-env-time (buffer-modified-tick))
|
||||||
elint-buffer-forms))
|
elint-buffer-forms))
|
||||||
|
|
||||||
(defun elint-get-top-forms ()
|
(defun elint-get-top-forms ()
|
||||||
|
|
@ -456,8 +455,8 @@ Return nil if there are no more forms, t otherwise."
|
||||||
(= 4 (length form))
|
(= 4 (length form))
|
||||||
(eq (car-safe (cadr form)) 'quote)
|
(eq (car-safe (cadr form)) 'quote)
|
||||||
(equal (nth 2 form) '(quote error-conditions)))
|
(equal (nth 2 form) '(quote error-conditions)))
|
||||||
(set (make-local-variable 'elint-extra-errors)
|
(setq-local elint-extra-errors
|
||||||
(cons (cadr (cadr form)) elint-extra-errors)))
|
(cons (cadr (cadr form)) elint-extra-errors)))
|
||||||
((eq (car form) 'provide)
|
((eq (car form) 'provide)
|
||||||
(add-to-list 'elint-features (eval (cadr form))))
|
(add-to-list 'elint-features (eval (cadr form))))
|
||||||
;; Import variable definitions
|
;; Import variable definitions
|
||||||
|
|
|
||||||
|
|
@ -1802,8 +1802,8 @@ Also sets `ert--results-progress-bar-button-begin'."
|
||||||
;; `progress-bar-button-begin' will be the right position
|
;; `progress-bar-button-begin' will be the right position
|
||||||
;; even in the results buffer.
|
;; even in the results buffer.
|
||||||
(with-current-buffer results-buffer
|
(with-current-buffer results-buffer
|
||||||
(set (make-local-variable 'ert--results-progress-bar-button-begin)
|
(setq-local ert--results-progress-bar-button-begin
|
||||||
progress-bar-button-begin))))
|
progress-bar-button-begin))))
|
||||||
(insert "\n\n")
|
(insert "\n\n")
|
||||||
(buffer-string))
|
(buffer-string))
|
||||||
;; footer
|
;; footer
|
||||||
|
|
@ -1979,15 +1979,15 @@ BUFFER-NAME, if non-nil, is the buffer name to use."
|
||||||
;; from ert-results-mode to ert-results-mode when
|
;; from ert-results-mode to ert-results-mode when
|
||||||
;; font-lock-mode turns itself off in change-major-mode-hook.)
|
;; font-lock-mode turns itself off in change-major-mode-hook.)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(set (make-local-variable 'font-lock-function)
|
(setq-local font-lock-function
|
||||||
'ert--results-font-lock-function)
|
'ert--results-font-lock-function)
|
||||||
(let ((ewoc (ewoc-create 'ert--print-test-for-ewoc nil nil t)))
|
(let ((ewoc (ewoc-create 'ert--print-test-for-ewoc nil nil t)))
|
||||||
(set (make-local-variable 'ert--results-ewoc) ewoc)
|
(setq-local ert--results-ewoc ewoc)
|
||||||
(set (make-local-variable 'ert--results-stats) stats)
|
(setq-local ert--results-stats stats)
|
||||||
(set (make-local-variable 'ert--results-progress-bar-string)
|
(setq-local ert--results-progress-bar-string
|
||||||
(make-string (ert-stats-total stats)
|
(make-string (ert-stats-total stats)
|
||||||
(ert-char-for-test-result nil t)))
|
(ert-char-for-test-result nil t)))
|
||||||
(set (make-local-variable 'ert--results-listener) listener)
|
(setq-local ert--results-listener listener)
|
||||||
(cl-loop for test across (ert--stats-tests stats) do
|
(cl-loop for test across (ert--stats-tests stats) do
|
||||||
(ewoc-enter-last ewoc
|
(ewoc-enter-last ewoc
|
||||||
(make-ert--ewoc-entry :test test
|
(make-ert--ewoc-entry :test test
|
||||||
|
|
|
||||||
|
|
@ -634,7 +634,7 @@ font-lock keywords will not be case sensitive."
|
||||||
;; and should make no difference for explicit fill
|
;; and should make no difference for explicit fill
|
||||||
;; because lisp-fill-paragraph should do the job.
|
;; because lisp-fill-paragraph should do the job.
|
||||||
;; I believe that newcomment's auto-fill code properly deals with it -stef
|
;; I believe that newcomment's auto-fill code properly deals with it -stef
|
||||||
;;(set (make-local-variable 'adaptive-fill-mode) nil)
|
;;(setq-local adaptive-fill-mode nil)
|
||||||
(setq-local indent-line-function 'lisp-indent-line)
|
(setq-local indent-line-function 'lisp-indent-line)
|
||||||
(setq-local indent-region-function 'lisp-indent-region)
|
(setq-local indent-region-function 'lisp-indent-region)
|
||||||
(setq-local comment-indent-function #'lisp-comment-indent)
|
(setq-local comment-indent-function #'lisp-comment-indent)
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ after OUT-BUFFER-NAME."
|
||||||
(with-current-buffer standard-output
|
(with-current-buffer standard-output
|
||||||
(emacs-lisp-mode)
|
(emacs-lisp-mode)
|
||||||
(setq buffer-read-only nil)
|
(setq buffer-read-only nil)
|
||||||
(set (make-local-variable 'font-lock-verbose) nil)))))
|
(setq-local font-lock-verbose nil)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun pp-eval-expression (expression)
|
(defun pp-eval-expression (expression)
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
|
||||||
|
|
||||||
(define-derived-mode reb-mode nil "RE Builder"
|
(define-derived-mode reb-mode nil "RE Builder"
|
||||||
"Major mode for interactively building Regular Expressions."
|
"Major mode for interactively building Regular Expressions."
|
||||||
(set (make-local-variable 'blink-matching-paren) nil)
|
(setq-local blink-matching-paren nil)
|
||||||
(reb-mode-common))
|
(reb-mode-common))
|
||||||
|
|
||||||
(defvar reb-lisp-mode-map
|
(defvar reb-lisp-mode-map
|
||||||
|
|
@ -832,8 +832,8 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
|
||||||
(let ((font-lock-is-on font-lock-mode))
|
(let ((font-lock-is-on font-lock-mode))
|
||||||
(font-lock-mode -1)
|
(font-lock-mode -1)
|
||||||
(kill-local-variable 'font-lock-set-defaults)
|
(kill-local-variable 'font-lock-set-defaults)
|
||||||
;;(set (make-local-variable 'reb-re-syntax) 'string)
|
;;(setq-local reb-re-syntax 'string)
|
||||||
;;(set (make-local-variable 'reb-re-syntax) 'rx)
|
;;(setq-local reb-re-syntax 'rx)
|
||||||
(setq font-lock-defaults
|
(setq font-lock-defaults
|
||||||
(cond
|
(cond
|
||||||
((memq reb-re-syntax '(read string))
|
((memq reb-re-syntax '(read string))
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,8 @@ See the documentation for `list-load-path-shadows' for further information."
|
||||||
|
|
||||||
(define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows"
|
(define-derived-mode load-path-shadows-mode fundamental-mode "LP-Shadows"
|
||||||
"Major mode for load-path shadows buffer."
|
"Major mode for load-path shadows buffer."
|
||||||
(set (make-local-variable 'font-lock-defaults)
|
(setq-local font-lock-defaults
|
||||||
'((load-path-shadows-font-lock-keywords)))
|
'((load-path-shadows-font-lock-keywords)))
|
||||||
(setq buffer-undo-list t
|
(setq buffer-undo-list t
|
||||||
buffer-read-only t))
|
buffer-read-only t))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1891,9 +1891,9 @@ KEYWORDS are additional arguments, which can use the following keywords:
|
||||||
(v (pop keywords)))
|
(v (pop keywords)))
|
||||||
(pcase k
|
(pcase k
|
||||||
(:forward-token
|
(:forward-token
|
||||||
(set (make-local-variable 'smie-forward-token-function) v))
|
(setq-local smie-forward-token-function v))
|
||||||
(:backward-token
|
(:backward-token
|
||||||
(set (make-local-variable 'smie-backward-token-function) v))
|
(setq-local smie-backward-token-function v))
|
||||||
(_ (message "smie-setup: ignoring unknown keyword %s" k)))))
|
(_ (message "smie-setup: ignoring unknown keyword %s" k)))))
|
||||||
(let ((ca (cdr (assq :smie-closer-alist grammar))))
|
(let ((ca (cdr (assq :smie-closer-alist grammar))))
|
||||||
(when ca
|
(when ca
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ set by `syntax-propertize'")
|
||||||
(setq syntax-propertize--done (max (point-max) pos))
|
(setq syntax-propertize--done (max (point-max) pos))
|
||||||
;; (message "Needs to syntax-propertize from %s to %s"
|
;; (message "Needs to syntax-propertize from %s to %s"
|
||||||
;; syntax-propertize--done pos)
|
;; syntax-propertize--done pos)
|
||||||
(set (make-local-variable 'parse-sexp-lookup-properties) t)
|
(setq-local parse-sexp-lookup-properties t)
|
||||||
(when (< syntax-propertize--done (point-min))
|
(when (< syntax-propertize--done (point-min))
|
||||||
;; *Usually* syntax-propertize is called via syntax-ppss which
|
;; *Usually* syntax-propertize is called via syntax-ppss which
|
||||||
;; takes care of adding syntax-ppss-flush-cache to b-c-f, but this
|
;; takes care of adding syntax-ppss-flush-cache to b-c-f, but this
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ be printed along with the arguments in the trace."
|
||||||
(ctx (funcall context)))
|
(ctx (funcall context)))
|
||||||
(unless inhibit-trace
|
(unless inhibit-trace
|
||||||
(with-current-buffer trace-buffer
|
(with-current-buffer trace-buffer
|
||||||
(set (make-local-variable 'window-point-insertion-type) t)
|
(setq-local window-point-insertion-type t)
|
||||||
(unless background (trace--display-buffer trace-buffer))
|
(unless background (trace--display-buffer trace-buffer))
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
;; Insert a separator from previous trace output:
|
;; Insert a separator from previous trace output:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue