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.
This commit is contained in:
Michael Heerdegen 2020-12-22 05:44:47 +01:00
parent ba011e487d
commit 96bbbaec5c
4 changed files with 17 additions and 5 deletions

View file

@ -0,0 +1,7 @@
;;; -*- lexical-binding: t -*-
(make-obsolete-variable 'bytecomp--tests-obsolete-var-2 nil "99.99")
(defun foo ()
(let ((bytecomp--tests-obsolete-var-2 2))
bytecomp--tests-obsolete-var-2))

View file

@ -625,6 +625,9 @@ Subtests signal errors if something goes wrong."
(bytecomp--define-warning-file-test "warn-obsolete-variable.el"
"bytecomp--tests-obs.*obsolete.*99.99")
(bytecomp--define-warning-file-test "warn-obsolete-variable-bound.el"
"bytecomp--tests-obs.*obsolete.*99.99" t)
(bytecomp--define-warning-file-test "warn-redefine-defun-as-macro.el"
"as both function and macro")