Maxim Cournoyer writes: > After passing from Emacs 26 to Emacs 27, the following snippet of code > doesn't behave the same: > > emacs --quick --batch --eval "(progn > ;(require 'autoload) > (let ((backup-inhibited t) > (generated-autoload-file \"/tmp/toto\")) > (update-directory-autoloads \"/tmp\")))" > > > Works on Emacs 26.3, but fails on Emacs 27.0.50, with the error message: > > Wrong type argument: stringp, nil The difference is that --eval now evaluates with lexical-binding enabled, so the let-binding of generated-autoload-file is lexical unless autoload.el, with its (defvar generated-autoload-file nil ...), has been loaded. Another way to demonstrate this: emacs -Q --batch -l bug-39823-autoload-regression.el fails with the same error, with bug-39823-autoload-regression.el as the attached file in both Emacs 26 and 27. Remove the lexical-binding setting, and it succeeds in both.