Stefan Monnier <[EMAIL PROTECTED]> writes:

>>> When loading a byte-compiled file that used define-generic-mode, I
>>> think you'll get an error that generic-mode-list is not defined
>>> (because generic.el doesn't get loaded: the autoload caused
>>> generic.el to be loaded during byte-compilation, but it doesn't
>>> have any such effect when loading the macro-expanded code).
>
>> Good point.  The same goes for calling generic-mode-internal.  I'll
>> add autoload cookies to generic-mode-list and generic-mode-internal.
>
> Maybe a better choice is to put a (require 'generic) in the macro
> expanded code.

I thought about that.  The difference is that adding (require
'generic) causes generic.el to be loaded the moment a file with a
compiled define-generic-mode call gets loaded.  Using autoload cookies
delays loading generic.el until the generic-mode function is actually
called.

I prefer the latter.  Maybe the mode function will never be called.
For example, it makes it possible to remove (require 'generic) from
generic-x.el.  So you can just load generic-x.elc to define a bunch of
major modes (and add them to auto-mode-alist) and generic.el will only
be loaded when you actually use one of them.

Why do you prefer adding (require 'generic)?

Lute.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to