]> git.eshelyaron.com Git - emacs.git/commit
eieio: Emit compilation warnings a bit more thoroughly
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 7 Apr 2025 03:39:40 +0000 (23:39 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:49:48 +0000 (07:49 +0200)
commit328617f0bba5c36df16cd068bec55873d1480f1b
tree2536988f11014143f334d02edc31530e38fccf9e
parent9eda9782e3cc85f743c96018ef2e1c0b61dc6986
eieio: Emit compilation warnings a bit more thoroughly

We used to warn about unknown slots only in `oref`: add the same check
for `oset` and `slot-boundp`.
Similarly, we warned about obsolete name args only when calling the
constructors: add the same check to `make-instance`.

* lisp/emacs-lisp/eieio-core.el (eieio--check-slot-name): New function
extracted from the compiler-macro of `eieio-oref`.
(eieio-oref, eieio-oset): Use it.
* lisp/emacs-lisp/eieio.el (slot-boundp): Use it.
 (eieio--constructor-macro): Add category to warning.
(make-instance): Add compiler-macro to warn about obsolete name.

(cherry picked from commit 71afa12941ebbd6fa2c010064de01db681985279)
lisp/emacs-lisp/eieio-core.el
lisp/emacs-lisp/eieio.el