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

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 23 Jun 2020 16:42:33 -0400

Hello Noam,

Noam Postavsky <[email-masked]> writes:

> 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))

That's much simpler, which is nice!  The only drawback is that it
requires the keyword argument to be used as the first argument when
provided (mine didn't have such restriction).

Provided the docstring reflects this, I'm OK with it :-).

Thank you,

Maxim