[Top][All Lists]

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

RE: doc of defining minor modes

From: Drew Adams
Subject: RE: doc of defining minor modes
Date: Fri, 19 May 2006 10:45:45 -0700

    > Consider a (typical) external library that is not required by any
    > other library. It is not part of Emacs itself; nothing in it is
    > preloaded. Are you saying that there is some way that browsing
    > Customize or using a menu or byte-compiling some file would cause
    > that library to be loaded? Is there some way for it to be loaded
    > without the user explicitly loading it? If so, this should be
    > explained, because it is really not obvious.

    Many external libraries use autoload cookies in order to create a
    short startup file that gets loaded unconditionally in order to make
    Emacs aware of the library's existence.

Yes, thanks. I almost added autoload cookies to the list myself, but I
didn't want to include something that wasn't already mentioned.

IIUC, if a external library has no autoload cookies (and it is not required
by another library etc.), then there should be no problem. Do you agree?

And even if a library has autoload cookies, there can be a problem only if
the user creates a loaddefs.el (or equivalent short startup file) that
includes those autoloads. That is, the user must explicitly do something in
order to manifest the problem in the case of a standalone library. And that
something is fairly sophisticated, in Lisp - e.g. use
`update-file-autoloads' on that library. This is hardly a case of surprising
an uninformed user. The library is not loaded behind his back in this case.

Of course, someone besides the end user might create the startup file based
on that library. But that person can then set the mode variable to nil. IOW,
if someone uninformed tries to use the library then there is no problem, and
if someone informed sets the library up for use by others then s?he will
know how to inhibit the mode at startup.

    > I do not see how Emacs would even know of the existence of such a
    > library until it is loaded.

    Autoloads.  It does not make sense for larger libraries to get loaded
    when they are possibly not going to be needed.

IIUC, it is not autoloads per se that are the problem, but creating a
startup file based on them. That is, a plain autoload (autoload 'foo-cmd
"foo" "foo t) that loads a library based on first use of a function should
not be a problem - do you agree?

The simple case of an unsophisticated user obtaining a standalone external
library and using it is, I think, quite common. And perhaps the most common
case is for such a library not to have autoload cookies.

For such simple cases, I don't see the problem arising. It would be good for
the doc to explain what the potential problem is and from where it can

reply via email to

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