1

For context, I'm writing an extension.

I need to check if a particular symbol is an autoload symbol, such that autoloadp = t.

After doing some digging I found that the defined autoloads in loaddefs.el do not match up with every declared autoload in the repository.

Check these screenshots out for clarity:

enter image description here


enter image description here


enter image description here


As shown, symbol org-capture-string is declared to be an autoload, which is accurately reflected in the loaddefs.el file.

But symbols orgtbl-exp-regexp and org-table-to-lisp are also declared to be an autoload, which is inaccurately reflected in the loaddefs.el file, since they are no where to be found.

What gives?

John DeBord
  • 570
  • 3
  • 14
  • Which version of Emacs? – phils Aug 25 '21 at 07:28
  • @phils Currently using the master branch. Are those symbols (and all others for that matter) accurately reflected in the loaddefs.el file in the most recent release? – John DeBord Aug 25 '21 at 08:07
  • I'm also seeing this pattern with the finder-inf.el file. cl-macs is clearly a built-in Emacs package, but it's no where to be found in the finder-inf.el file – John DeBord Aug 25 '21 at 09:11

3 Answers3

1

loaddefs.el is automatically generated at build time. See src/Makefile.in line 774 (in whatever version I happened to have checked out; it might be a different line in yours).

db48x
  • 17,977
  • 1
  • 22
  • 28
  • How is the cus-load.el file even generated when the function custom-make-dependencies isn't even defined? https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/lisp/Makefile.in#L154. Am I missing something? – John DeBord Aug 25 '21 at 09:26
  • 1
    Note the -l cus-dep on that line. This tells it to load the cus-dep.el file first, where custom-make-dependencies is located. Since that function isn’t needed most of the time, it isn’t even marked for autoloading. You can load the file if you want: (load "cus-dep") – db48x Aug 25 '21 at 09:42
  • not sure how I skipped over that when grepping for it; thanks – John DeBord Aug 25 '21 at 18:33
1

You'll find the org loaddefs in org-loaddefs.el, due to the file-local variable generated-autoload-file.

cl-macs is not a package, it is an internal component of cl-lib, which is in finder-inf.el.

Aaron Hall
  • 434
  • 1
  • 6
  • 20
0

In addition to what @db48x said, this is how it happens, and how you can yourself update loaddefs.el (or another file of autoloads). C-h f batch-update-autoloads tells us:

batch-update-autoloads is an autoloaded Lisp function in autoload.el.

(batch-update-autoloads)

Update loaddefs.el autoloads in batch mode.

Calls update-directory-autoloads on the command line arguments. Definitions are written to generated-autoload-file (which should be non-nil).

See also update-directory-autoloads, update-file-autoloads, and w32-batch-update-autoloads.

Drew
  • 77,472
  • 10
  • 114
  • 243
  • So from my understanding, someone forgot to update ldefs-boot.el for the symbols orgtbl-exp-regexp and org-table-to-lisp (in my example (I'm assuming there are others as well))? – John DeBord Aug 25 '21 at 20:10