diff options
| author | Stefan Monnier | 2024-02-11 22:19:49 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2024-02-11 22:19:49 -0500 |
| commit | 57544fa2a2e1f2d04aa6b6bdf49bde71141b945d (patch) | |
| tree | 2e416dfc199a007e89412f6311961f8fa55e36b9 | |
| parent | 806759dc0a6a3b049ce35d0497011464e5fc4dcb (diff) | |
| download | emacs-57544fa2a2e1f2d04aa6b6bdf49bde71141b945d.tar.gz emacs-57544fa2a2e1f2d04aa6b6bdf49bde71141b945d.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/loaddefs-gen.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 1e91e84157d..238ec9d179b 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el | |||
| @@ -183,7 +183,9 @@ expression, in which case we want to handle forms differently." | |||
| 183 | (loaddefs-generate--shorten-autoload | 183 | (loaddefs-generate--shorten-autoload |
| 184 | `(autoload ,(nth 1 form) ,file ,doc ,interactive ,type)))) | 184 | `(autoload ,(nth 1 form) ,file ,doc ,interactive ,type)))) |
| 185 | 185 | ||
| 186 | ((and expansion (memq car '(progn prog1))) | 186 | ;; Look inside `progn', and `eval-and-compile', since these |
| 187 | ;; are often used in the expansion of things like `pcase-defmacro'. | ||
| 188 | ((and expansion (memq car '(progn prog1 eval-and-compile))) | ||
| 187 | (let ((end (memq :autoload-end form))) | 189 | (let ((end (memq :autoload-end form))) |
| 188 | (when end ;Cut-off anything after the :autoload-end marker. | 190 | (when end ;Cut-off anything after the :autoload-end marker. |
| 189 | (setq form (copy-sequence form)) | 191 | (setq form (copy-sequence form)) |