[Top][All Lists]

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

Re: Generalizing find-definition

From: David Engster
Subject: Re: Generalizing find-definition
Date: Thu, 11 Dec 2014 22:53:37 +0100
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.91 (gnu/linux)

Helmut Eller writes:
> On Thu, Dec 11 2014, David Engster wrote:
>> Helmut Eller writes:
>>>> Too bad that classes can't be autoloaded.
>> They can. CEDET does that all the time.
> Ah, that's great!
>>>   ;;;###autoload (autoload 'etags-xref-backend "etags")
>>>   (defclass etags-xref-backend (xref-backend-class eieio-singleton) ())
>> Uhm, did you try to simply putting ";;;###autoload" before a class
>> definition? It should work just fine (through
>> `eieio-defclass-autoload').
> Yes, I tried but got this error:
>   ...
>   Loading loaddefs.el (source)...
>   Attempt to autoload eieio-defclass-autoload while preparing to dump
>   make[1]: *** [emacs] Error 1

EIEIO is not available at startup. You have to explicitly 'require' it
before autoloading of classes can work.

>> However, there *is* a problem with autoloading classes, namely that
>> EIEIO should not be loaded at Emacs startup. This is why this feature is
>> currently restricted to the CEDET subsystem which is only loaded when
>> you activate Semantic or EDE.
> So what's the recommended way to do it for a file in lisp/progmodes/ ?

The only way is to separate everything that needs EIEIO into a separate
file with its own autoloads. This usually does not make sense for a
small package, though. So really, the best way is to have one central
autoload for your package (usually a major/minor mode).


reply via email to

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