From: Lute Kamstra <Lute.Kamstra.lists@xs4all.nl>
Cc: emacs-devel@gnu.org
Subject: Re: lisp/generic.el patch.
Date: Tue, 15 Mar 2005 22:47:11 +0100 [thread overview]
Message-ID: <87hdjc7fa8.fsf@xs4all.nl> (raw)
In-Reply-To: <87y8colji9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 15 Mar 2005 15:52:40 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> 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.
next prev parent reply other threads:[~2005-03-15 21:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-15 17:06 lisp/generic.el patch Lute Kamstra
2005-03-15 18:53 ` Stefan Monnier
2005-03-15 20:19 ` Lute Kamstra
2005-03-15 20:52 ` Stefan Monnier
2005-03-15 21:47 ` Lute Kamstra [this message]
2005-03-21 22:48 ` Luc Teirlinck
2005-03-16 16:22 ` Richard Stallman
2005-03-16 16:37 ` Lute Kamstra
2005-03-16 16:37 ` David Kastrup
2005-03-17 23:01 ` Richard Stallman
2005-03-17 16:34 ` Lute Kamstra
2005-03-17 16:39 ` Lute Kamstra
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=87hdjc7fa8.fsf@xs4all.nl \
--to=lute.kamstra.lists@xs4all.nl \
--cc=emacs-devel@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.