1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

loaddefs-gen.el: Generate an autoload for pcase-defmacro

Autoload cookies on uses of `pcase-defmacro` used to copy
the definition wholesale instead of generating the expected autoload.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Look inside `eval-and-compile` as well.
This commit is contained in:
Stefan Monnier 2024-02-11 22:19:49 -05:00
parent 806759dc0a
commit 57544fa2a2

View file

@ -183,7 +183,9 @@ expression, in which case we want to handle forms differently."
(loaddefs-generate--shorten-autoload
`(autoload ,(nth 1 form) ,file ,doc ,interactive ,type))))
((and expansion (memq car '(progn prog1)))
;; Look inside `progn', and `eval-and-compile', since these
;; are often used in the expansion of things like `pcase-defmacro'.
((and expansion (memq car '(progn prog1 eval-and-compile)))
(let ((end (memq :autoload-end form)))
(when end ;Cut-off anything after the :autoload-end marker.
(setq form (copy-sequence form))