Given a variable or a function symbol not currently bound, what would be the variable that holds the auto-loading association I could use to search for the symbol and find out what file would get loaded when it is invoked?
You can use
symbol-function to get the function associated with a symbol. If the function hasn’t been loaded yet, then this will be a list starting with the symbol
autoload rather than an actual function object. The other elements in this list mean other things; in particular, the second element of the list is the name of the file to load. For example, if you run
(symbol-function '5x5), you may see something like this:
(autoload "5x5" 810998 t nil)
autoloadp will check that first element and return
t if it is
'autoload, but as far as I know the rest of the elements don’t have named accessor functions. Just use
(nth 2 …) or whatever you prefer.
Neither variable nor function. Autoloads are defined in (one or more) files. The default file for this is
loaddefs.el, provided with Emacs.
This is explained in the Elisp manual, node
M-x update-file-autoloadswrites a corresponding autoload call into
loaddefs.el. (The string that serves as the autoload cookie and the name of the file generated by
update-file-autoloadscan be changed from the above defaults, see below.) Building Emacs loads
loaddefs.eland thus calls autoload.
M-x update-directory-autoloadsis even more powerful; it updates autoloads for all files in the current directory.
So you can have autoloads in any file you like, if you generate (or update) the file. Packages can provide an autoloads file as part of their recipe, for example. But the main - the default - autoloads file is
If you or some program has never updated
loaddefs.el then it is no doubt in the state in which it was delivered as part of Emacs.
If you install some packages then likely associated autoloads files exist for some of them, and those autoload files are loaded when you install those packages.
Then, when you invoke something that's autoloaded via one of those autoload files, the associated package gets loaded.
If you know the package of some object (function, var, or other) you're interested in, then look for that package's autoloads file (e.g. in the package's directory). It contains the autoload associations you're asking about (for that package).
On the other hand, if you just want to know if something is an autoload object (function or variable or sexp), use predicate