Function: autoload
autoload is a function defined in eval.c.
Signature
(autoload FUNCTION FILE &optional DOCSTRING INTERACTIVE TYPE)
Documentation
Define FUNCTION to autoload from FILE.
FUNCTION is a symbol; FILE is a file name string to pass to load.
Third arg DOCSTRING is documentation for the function.
Fourth arg INTERACTIVE if non-nil says function can be called interactively. If INTERACTIVE is a list, it is interpreted as a list of modes the function is applicable for.
Fifth arg TYPE indicates the type of the object:
nil or omitted says FUNCTION is a function,
keymap says FUNCTION is really a keymap, and
macro or t says FUNCTION is really a macro.
Third through fifth args give info about the real definition. They default to nil.
If FUNCTION is already defined other than as an autoload, this does nothing and returns nil.
Probably introduced at or before Emacs version 20.1.
Source Code
// Defined in /usr/src/emacs/src/eval.c
{
CHECK_SYMBOL (function);
CHECK_STRING (file);
/* If function is defined and not as an autoload, don't override. */
if (!NILP (XSYMBOL (function)->u.s.function)
&& !AUTOLOADP (XSYMBOL (function)->u.s.function))
return Qnil;
if (!NILP (Vpurify_flag) && EQ (docstring, make_fixnum (0)))
/* `read1' in lread.c has found the docstring starting with "\
and assumed the docstring will be provided by Snarf-documentation, so it
passed us 0 instead. But that leads to accidental sharing in purecopy's
hash-consing, so we use a (hopefully) unique integer instead. */
docstring = make_ufixnum (XHASH (function));
return Fdefalias (function,
list5 (Qautoload, file, docstring, interactive, type),
Qnil);
}