[Top][All Lists]

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

Re: lisp/generic.el patch.

From: Lute Kamstra
Subject: Re: lisp/generic.el patch.
Date: Tue, 15 Mar 2005 22:47:11 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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

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)?


reply via email to

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