Support `cl-defstruct' in autoloads

* lisp/emacs-lisp/autoload.el (make-autoload): Add `cl-defstruct' to
"complex cases" list.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add :autoload-end to
limit what is declared in autoloads.el for a defstruct.
This commit is contained in:
Stephen Leake 2019-09-10 03:36:15 -07:00
parent a13c64204c
commit ac1a2e260e
2 changed files with 2 additions and 1 deletions

View file

@ -165,7 +165,7 @@ expression, in which case we want to handle forms differently."
define-globalized-minor-mode defun defmacro define-globalized-minor-mode defun defmacro
easy-mmode-define-minor-mode define-minor-mode easy-mmode-define-minor-mode define-minor-mode
define-inline cl-defun cl-defmacro cl-defgeneric define-inline cl-defun cl-defmacro cl-defgeneric
pcase-defmacro)) cl-defstruct pcase-defmacro))
(macrop car) (macrop car)
(setq expand (let ((load-file-name file)) (macroexpand form))) (setq expand (let ((load-file-name file)) (macroexpand form)))
(memq (car expand) '(progn prog1 defalias))) (memq (car expand) '(progn prog1 defalias)))

View file

@ -3006,6 +3006,7 @@ Supported keywords for slots are:
`(progn `(progn
(defvar ,tag-symbol) (defvar ,tag-symbol)
,@(nreverse forms) ,@(nreverse forms)
:autoload-end
;; Call cl-struct-define during compilation as well, so that ;; Call cl-struct-define during compilation as well, so that
;; a subsequent cl-defstruct in the same file can correctly include this ;; a subsequent cl-defstruct in the same file can correctly include this
;; struct as a parent. ;; struct as a parent.