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

From: Noam Postavsky <[email-masked]>
Date: Mon, 22 Jun 2020 11:07:25 -0400

Maxim Cournoyer <[email-masked]> writes:

> +  (let* (;; Honor the :generated-autoload-file keyword argument.
> +         (generated-autoload-file-arg (seq-position
> +                                       dirs ':generated-autoload-file))
> +         (generated-autoload-file (if generated-autoload-file-arg
> +                                      (elt dirs
> +                                           (1+ generated-autoload-file-arg))
> +                                    generated-autoload-file))
> +         ;; Cleanup dirs from such keyword argument, if any.
> +         (dirs (if generated-autoload-file-arg
> +                   (delete generated-autoload-file
> +                           (delete ':generated-autoload-file dirs))
> +                 dirs))

How about

    (let* ((generated-autoload-file
            (if (eq (car dirs) :generated-autoload-file)
                (progn (pop dirs) (pop dirs))
              generated-autoload-file))