]> git.eshelyaron.com Git - emacs.git/commitdiff
loaddefs-gen.el: Generate an autoload for `pcase-defmacro`
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Feb 2024 03:19:49 +0000 (22:19 -0500)
committerEshel Yaron <me@eshelyaron.com>
Mon, 12 Feb 2024 07:02:55 +0000 (08:02 +0100)
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.

(cherry picked from commit 57544fa2a2e1f2d04aa6b6bdf49bde71141b945d)

lisp/emacs-lisp/loaddefs-gen.el

index 1e91e84157d406c577c4b26b23c768f06940b99a..238ec9d179bc654c4b8fe762f7b88f0bc230cb4e 100644 (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))