(loaddefs-generate--make-autoload): Fix bug#80180

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Avoid accidentally loading the `.elc` file.
This commit is contained in:
Stefan Monnier 2026-01-13 16:53:45 -05:00
parent ab8b052888
commit 986aaf06cd

View file

@ -228,7 +228,11 @@ expand)' among their `declare' forms."
(member file loaddefs--load-error-files))
(let ((load-path (cons (file-name-directory file) load-path)))
(message "loaddefs-gen: loading file %s (for %s)" file car)
(condition-case e (load file)
(condition-case e
;; Don't load the `.elc' file, in case the file wraps
;; the macro-definition in `eval-when-compile' (bug#80180).
(let ((load-suffixes '(".el")))
(load file))
(error
(push file loaddefs--load-error-files) ; do not attempt again
(warn "loaddefs-gen: load error\n\t%s" e)))))