help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: eieio persistent, plus autoloads


From: Eric Abrahamsen
Subject: Re: eieio persistent, plus autoloads
Date: Fri, 16 Aug 2013 10:03:33 +0800
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

David Engster <deng@randomsample.de> 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




reply via email to

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