From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Fixing "Unknown slot" warnings Date: Sun, 29 Jan 2017 22:26:14 +0100 Message-ID: <87vasx8snd.fsf@engster.org> References: <87sho2m458.fsf@engster.org> <87o9ypnako.fsf@engster.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485725186 3439 195.159.176.226 (29 Jan 2017 21:26:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2017 21:26:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 29 22:26:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cXwzN-0000ma-Ae for ged-emacs-devel@m.gmane.org; Sun, 29 Jan 2017 22:26:21 +0100 Original-Received: from localhost ([::1]:56827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXwzS-0003Lb-Kn for ged-emacs-devel@m.gmane.org; Sun, 29 Jan 2017 16:26:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cXwzM-0003LV-BD for emacs-devel@gnu.org; Sun, 29 Jan 2017 16:26:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cXwzJ-0000js-7S for emacs-devel@gnu.org; Sun, 29 Jan 2017 16:26:20 -0500 Original-Received: from randomsample.de ([5.45.97.173]:56246) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cXwzJ-0000im-0d for emacs-devel@gnu.org; Sun, 29 Jan 2017 16:26:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=/lhNIA4MleaR07ZCbJpXsNugO812S2u4cMHEvVezw/I=; b=bj1ZoY+19WZOgrhg8AaC7N0l+j37LTlR7AIIRPRU445CSamnGzjZtxilmlEbhUSJ2prgN0dN0hsxY0wQ7t5Eb/5/jy5ToVS1Ro1RbRsJgxoce0vL1B8zDLc7v0PKlfs2; Original-Received: from ip4d16b353.dynamic.kabel-deutschland.de ([77.22.179.83] helo=isaac) by randomsample.de with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1cXwzH-0006oh-Ea; Sun, 29 Jan 2017 22:26:15 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 29 Jan 2017 12:07:13 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.45.97.173 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211736 Archived-At: Stefan Monnier writes: >> 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). OK, I'll add that to EIEIO. > 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. The new CEDET will only target the current master, so I finally don't have to care about older Emacsen anymore. -David