diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-20 20:17:11 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-20 20:17:11 -0500 |
commit | b9511362f5fe4dc772cb2b65afeb051a7443f2a4 (patch) | |
tree | 884dd757c73100d7609c036c495bf5cfc8c122f1 /lisp/emacs-lisp | |
parent | 0df23b73e4718937bcaddf9008ad8ef9ca3a2413 (diff) | |
download | emacs-b9511362f5fe4dc772cb2b65afeb051a7443f2a4.tar.gz emacs-b9511362f5fe4dc772cb2b65afeb051a7443f2a4.tar.bz2 emacs-b9511362f5fe4dc772cb2b65afeb051a7443f2a4.zip |
* lisp/emacs-lisp/bytecomp.el (byte-compile--declare-var): Fix warning
Make sure the "declared after first use" is under the control of
the `lexical` option.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 360da6b6ba6..9429d6a0d5d 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2505,7 +2505,8 @@ list that represents a doc string reference. (when (memq sym byte-compile-lexical-variables) (setq byte-compile-lexical-variables (delq sym byte-compile-lexical-variables)) - (byte-compile-warn "Variable `%S' declared after its first use" sym)) + (when (byte-compile-warning-enabled-p 'lexical sym) + (byte-compile-warn "Variable `%S' declared after its first use" sym))) (push sym byte-compile-bound-variables) (push sym byte-compile--seen-defvars)) |