diff options
author | Michael Heerdegen <michael_heerdegen@web.de> | 2020-12-22 05:44:47 +0100 |
---|---|---|
committer | Michael Heerdegen <michael_heerdegen@web.de> | 2021-01-06 10:51:28 +0100 |
commit | 96bbbaec5c1b2612946ff08abf9d43e7478e8c43 (patch) | |
tree | 95d9e25909bc926b1cbe911d604393d88142d73b /lisp/emacs-lisp/bytecomp.el | |
parent | ba011e487d40b96691d3e7af917ff6ce9d7c7a00 (diff) | |
download | emacs-96bbbaec5c1b2612946ff08abf9d43e7478e8c43.tar.gz emacs-96bbbaec5c1b2612946ff08abf9d43e7478e8c43.tar.bz2 emacs-96bbbaec5c1b2612946ff08abf9d43e7478e8c43.zip |
Fix obsolete variable warnings about class names
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload): Try to make
the wording of the warning about the obsoleted variable less confusing.
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-variable): Don't
warn for lexical variables (Bug#39169). Fix spurious `or'.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp/warn-obsolete-variable-bound\.el): New test.
* test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-bound.el:
New file.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 76457814acd..360da6b6ba6 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3441,10 +3441,11 @@ for symbols generated by the byte compiler itself." (and od (not (memq var byte-compile-not-obsolete-vars)) (not (memq var byte-compile-global-not-obsolete-vars)) - (or (pcase (nth 1 od) - ('set (not (eq access-type 'reference))) - ('get (eq access-type 'reference)) - (_ t))))) + (not (memq var byte-compile-lexical-variables)) + (pcase (nth 1 od) + ('set (not (eq access-type 'reference))) + ('get (eq access-type 'reference)) + (_ t)))) (byte-compile-warn-obsolete var)))) (defsubst byte-compile-dynamic-variable-op (base-op var) |