Subject: bug#26782: describe-function and autoloads not in main loaddefs

From: Glenn Morris <[email-masked]>
Date: Fri, 05 May 2017 01:57:13 -0400

Package: emacs
Version: 25.2
Severity: minor

emacs -Q -l cl-lib
C-h f cl-assoc
 -> "cl-assoc is an autoloaded Lisp function..."

This creates the confusing impression that you can expect to use
cl-assoc (eg) in emacs -Q. But you can't, because while it does have an
autoload cookie, it's in a file with generated-autoload-file non-nil, so
the autoloads don't go into the main loaddefs.el file. The autoload is
just an internal implementation detail of cl-lib that users should not
be concerned about. The same applies for other places that set
generated-autoload-file non-nil; eg rmail-add-label.

Perhaps the "autoloaded" bit should not be included in the
describe-function output if the autoload isn't in the main loaddefs
file. Or maybe it should be qualified somehow, though I'm not sure it
would be useful information.

The issue is going to get even more confusing in Emacs 26.1, where the
new definition-prefixes feature means that you don't even have to
explicitly load the main library any more. Eg:

emacs-25.2 -Q -l rmail
C-h f rmail- TAB
rmail-add-label
-> "rmail-add-label is an interactive autoloaded Lisp function"

In Emacs 26.1, you won't even need the "-l rmail" to get rmail-add-label
returned as a completion.