summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easy-mmode.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-01-31 14:55:53 +0100
committerStefan Kangas <stefan@marxist.se>2021-01-31 14:55:53 +0100
commit5f69c222f47dfb339304b57083cb68c1da340271 (patch)
tree6a39995a68fa9b45ad08b176c906dda3d069de65 /lisp/emacs-lisp/easy-mmode.el
parent4d635ceffbdfc3f709c09d25d28421e7816ecd8f (diff)
downloademacs-5f69c222f47dfb339304b57083cb68c1da340271.tar.gz
emacs-5f69c222f47dfb339304b57083cb68c1da340271.tar.bz2
emacs-5f69c222f47dfb339304b57083cb68c1da340271.zip
Prefer defvar-local in emacs-lisp/*.el
* lisp/emacs-lisp/chart.el (chart-local-object): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode) (define-globalized-minor-mode): * lisp/emacs-lisp/edebug.el: * lisp/emacs-lisp/generic.el (generic-font-lock-keywords): * lisp/emacs-lisp/re-builder.el (reb-regexp, reb-regexp-src) (reb-overlays): * lisp/emacs-lisp/syntax.el (syntax-propertize-extend-region-functions): Prefer defvar-local.
Diffstat (limited to 'lisp/emacs-lisp/easy-mmode.el')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index f4dbcee4d69..54c0cf08b78 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -278,11 +278,10 @@ For example, you could write
((not globalp)
`(progn
:autoload-end
- (defvar ,mode ,init-value
+ (defvar-local ,mode ,init-value
,(concat (format "Non-nil if %s is enabled.\n" pretty-name)
(internal--format-docstring-line
- "Use the command `%s' to change this variable." mode)))
- (make-variable-buffer-local ',mode)))
+ "Use the command `%s' to change this variable." mode)))))
(t
(let ((base-doc-string
(concat "Non-nil if %s is enabled.
@@ -453,8 +452,7 @@ on if the hook has explicitly disabled it.
(progn
(put ',global-mode 'globalized-minor-mode t)
:autoload-end
- (defvar ,MODE-major-mode nil)
- (make-variable-buffer-local ',MODE-major-mode))
+ (defvar-local ,MODE-major-mode nil))
;; The actual global minor-mode
(define-minor-mode ,global-mode
,(concat (format "Toggle %s in all buffers.\n" pretty-name)