Subject: bug#39823: 26.3; update-directory-autoloads regression from Emacs 26 to Emacs 27

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 30 Sep 2020 17:23:21 +0200

Maxim Cournoyer <[email-masked]> writes:

> I've given this idea a try with the attached patch.  For some reason I
> can't seem to simply eval the definition to test it (Debugger
> entered--Lisp error: (void-function byte-compile-info-string).  I'm
> rebuilding Emacs with the change right now.

[...]

> This provides a way to explicitly specify the GENERATED-AUTOLOAD-FILE
> file name to use for the generated autoload definitions, which is more
> convenient when using lexical scoping.  Previously, the user had to
> use dynamic scoping and bind the variable before calling
> `update-directory-autoloads'.  This was discussed in
> <https://bugs.gnu.org/39823>.

This seems like a good change -- I'm all for explicit function arguments
instead of binding variables around the call.

[...]

>  ;;;###autoload
> -(defun update-directory-autoloads (&rest dirs)
> +(cl-defun update-directory-autoloads (&rest dirs
> +                                            &key (generated-autoload-file
> +                                                  generated-autoload-file)
> +                                            &allow-other-keys)

But I'm not really enthusiastic about this complicated function
signature.  The doc string to the function already goes on way too long
to explain what the parameter means.

I think it would make more sense to introduce a new function, say,
`make-directory-autoloads' (because it doesn't so much update the
autoloads as create an autoload file, I think?) with a sane function
signature, and then deprecate update-directory-autoloads (which is only
used a handful of place in the Emacs tree).

Any comments?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no