From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: eieio persistent, plus autoloads
Date: Fri, 16 Aug 2013 10:03:33 +0800 [thread overview]
Message-ID: <87ppteie8a.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87vc37os66.fsf@arcor.de
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
next prev parent reply other threads:[~2013-08-16 2:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 10:45 eieio persistent, plus autoloads Eric Abrahamsen
2013-08-15 16:05 ` David Engster
2013-08-16 2:03 ` Eric Abrahamsen [this message]
2013-08-16 15:18 ` David Engster
2013-08-17 4:11 ` Eric Abrahamsen
2013-08-17 7:21 ` David Engster
2013-08-19 2:18 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ppteie8a.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.