[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b951136 1/5: * lisp/emacs-lisp/bytecomp.el (byte-compile--declare

From: Stefan Monnier
Subject: master b951136 1/5: * lisp/emacs-lisp/bytecomp.el (byte-compile--declare-var): Fix warning
Date: Wed, 20 Jan 2021 23:57:05 -0500 (EST)

branch: master
commit b9511362f5fe4dc772cb2b65afeb051a7443f2a4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * 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.
 lisp/emacs-lisp/bytecomp.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 360da6b..9429d6a 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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]