From: Stefan Kangas Date: Mon, 7 Dec 2020 10:14:22 +0000 (+0100) Subject: Prefer setq-local in whitespace.el X-Git-Tag: emacs-28.0.90~4891 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8a42354b0a00e47e13fa4068d99afef0e05da25e;p=emacs.git Prefer setq-local in whitespace.el * lisp/whitespace.el (whitespace-turn-on, whitespace-color-on): Prefer setq-local. --- diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 02ee7bcf7fd..814f3e5a5f6 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1986,13 +1986,13 @@ resultant list will be returned." ;; prepare local hooks (add-hook 'write-file-functions 'whitespace-write-file-hook nil t) ;; create whitespace local buffer environment - (set (make-local-variable 'whitespace-font-lock-keywords) nil) - (set (make-local-variable 'whitespace-display-table) nil) - (set (make-local-variable 'whitespace-display-table-was-local) nil) - (set (make-local-variable 'whitespace-active-style) - (if (listp whitespace-style) - whitespace-style - (list whitespace-style))) + (setq-local whitespace-font-lock-keywords nil) + (setq-local whitespace-display-table nil) + (setq-local whitespace-display-table-was-local nil) + (setq-local whitespace-active-style + (if (listp whitespace-style) + whitespace-style + (list whitespace-style))) ;; turn on whitespace (when whitespace-active-style (whitespace-color-on) @@ -2034,19 +2034,14 @@ resultant list will be returned." "Turn on color visualization." (when (whitespace-style-face-p) ;; save current point and refontify when necessary - (set (make-local-variable 'whitespace-point) - (point)) + (setq-local whitespace-point (point)) (setq whitespace-point--used (let ((ol (make-overlay (point) (point) nil nil t))) (delete-overlay ol) ol)) - (set (make-local-variable 'whitespace-font-lock-refontify) - 0) - (set (make-local-variable 'whitespace-bob-marker) - (point-min-marker)) - (set (make-local-variable 'whitespace-eob-marker) - (point-max-marker)) - (set (make-local-variable 'whitespace-buffer-changed) - nil) + (setq-local whitespace-font-lock-refontify 0) + (setq-local whitespace-bob-marker (point-min-marker)) + (setq-local whitespace-eob-marker (point-max-marker)) + (setq-local whitespace-buffer-changed nil) (add-hook 'post-command-hook #'whitespace-post-command-hook nil t) (add-hook 'before-change-functions #'whitespace-buffer-changed nil t) ;; Add whitespace-mode color into font lock.