From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: eieio persistent, plus autoloads Date: Fri, 16 Aug 2013 10:03:33 +0800 Message-ID: <87ppteie8a.fsf@ericabrahamsen.net> References: <87siybjkpy.fsf@ericabrahamsen.net> <87vc37os66.fsf@arcor.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376618610 11052 80.91.229.3 (16 Aug 2013 02:03:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 02:03:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 04:03:32 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VA9Nx-0008TU-Pa for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 04:03:29 +0200 Original-Received: from localhost ([::1]:56273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA9Nx-00051e-6a for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Aug 2013 22:03:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA9Ni-00050e-70 for help-gnu-emacs@gnu.org; Thu, 15 Aug 2013 22:03:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VA9Nd-0007PY-Ia for help-gnu-emacs@gnu.org; Thu, 15 Aug 2013 22:03:14 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA9Nd-0007PM-Ch for help-gnu-emacs@gnu.org; Thu, 15 Aug 2013 22:03:09 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VA9Nb-0008BJ-Mz for help-gnu-emacs@gnu.org; Fri, 16 Aug 2013 04:03:07 +0200 Original-Received: from 50.56.99.223 ([50.56.99.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Aug 2013 04:03:07 +0200 Original-Received: from eric by 50.56.99.223 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Aug 2013 04:03:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 50.56.99.223 User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Chuh/mk1nw1RZONMYJGw3UObIiU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92922 Archived-At: David Engster writes: > Eric Abrahamsen writes: >> Working backwards, I envision it happening like this: at the top of the >> BBDB code, in a spot that gets loaded before any databases are read, >> there's a line like this: >> >> (load "bbdb-loaddefs.el" t t t) >> >> That file would be full of autoload statements, created by >> eieio-defclass-autoload, for any custom subclass that's been created. >> The question is, how do I get those statements in there? > > It might very well be that I don't understand what you're trying to do, > but `eieio-defclass-autoload' is used the same way as the normal > `autoload': you either call it manually, or you use a magic autoload > comment in front of `defclass' and run the files through > `update-file-autoloads', so that those statements get generated for > you. Why doesn't that work in your case? Yeah, I didn't do a terribly good job of expressing the problem... That doesn't work because when users or third-party package managers want to subclass, say, the bbdb-field class, they would have to remember to do this: ;;;###autoload (eieio-defclass-autoload 'my-field-class "thisfile.el") (defclass my-field-class (bbdb-field) etc etc It just seems a lot safer to have something automatic. And even the above would not result in the autoload statement getting written to the custom loaddefs file. So I was thinking either hot-wire `defclass' (probably with advice), or provide a special macro for subclassing these classes. But both of those solutions have the same problem: as far as I can tell, calling `eieio-defclass-autoload' in a program, followed by `update-file-autoloads', does *not* write anything to a loaddef file, that only happens when compiling a file with autoload cookies in it. So... now I'm thinking that, if I really want to insist on this, I'll still go the macro route, but just use some of the bits and pieces from autoload.el and cobble together something semi-manual. I don't know, maybe I've answered my own question... Eric