emacs-devel
[Top][All Lists]
Advanced

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

Re: Fixing "Unknown slot" warnings


From: Stefan Monnier
Subject: Re: Fixing "Unknown slot" warnings
Date: Sun, 29 Jan 2017 12:07:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux)

> After looking at the code, it seems all slot symbols are shoved into
> `eieio--known-slot-names' and the byte-compiler checks if a slot is in
> there, regardless of the class being used. So the following would
> already do the trick:

> (defmacro eieio-declare-slot (name)
>   "Declares slot to be available at runtime."
>   `(eval-when-compile (cl-pushnew ,name eieio--known-slot-names)))

If you mean something to add to eieio, then yes, that's about right
(tho you could also do it as (defmacro eieio-declare-slot (name)
(cl-pushnew name eieio--known-slot-names) nil).

My `defclass` solution was meant for use in code that must work with
older Emacsen and/or older eieio without relying on internals like 
eieio--known-slot-names.


        Stefan




reply via email to

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