Lars Ingebrigtsen [2022-05-31 12:09 -0400] wrote: > branch: master > commit 1d4e90341782030cc7d8c29c639450b079587908 > Author: Lars Ingebrigtsen > Commit: Lars Ingebrigtsen > > Speed up generation of loaddefs files [...] > * lisp/emacs-lisp/package.el: Use loaddefs-generate instead of > make-directory-autoloads. [...] > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index b340848a6f..48551f59b4 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -1003,6 +1003,7 @@ untar into a directory named DIR; otherwise, signal an error." > > (defun package-autoload-ensure-default-file (file) > "Make sure that the autoload file FILE exists and if not create it." > + (declare (obsolete nil "29.1")) > (unless (file-exists-p file) > (require 'autoload) > (let ((coding-system-for-write 'utf-8-emacs-unix)) > @@ -1021,8 +1022,11 @@ untar into a directory named DIR; otherwise, signal an error." > (autoload-timestamps nil) > (backup-inhibited t) > (version-control 'never)) > - (package-autoload-ensure-default-file output-file) > - (make-directory-autoloads pkg-dir output-file) > + (loaddefs-generate > + pkg-dir output-file > + nil > + "(add-to-list 'load-path (directory-file-name > + (or (file-name-directory #$) (car load-path))))") > (let ((buf (find-buffer-visiting output-file))) > (when buf (kill-buffer buf))) > auto-name)) Since this change, installation and activation of packages lacking autoloads signals a (demoted) error. For example: $ cd "$(mktemp -d)" $ export HOME="$PWD" XDG_CONFIG_HOME="$PWD/.config" $ emacs -Q -f toggle-debug-on-error (setq package-archives '(("melpa" . "https://melpa.org/packages/"))) C-x C-e M-x package-install RET sicp RET Error loading autoloads: (file-missing Cannot open load file No such file or directory /tmp/tmp.6gK5WLWds9/.emacs.d/elpa/sicp-20200512.1137/sicp-autoloads) Backtrace attached. The same error occurs with a subsequent: C-x C-c $ emacs -Q M-x package-initialize RET I guess either the -autoloads.el file should continue to be generated unconditionally, or its nonexistence should not be regarded as an error. Thanks, -- Basil