• Stefan Monnier's avatar
    Add online-help support to describe types · 59b5723c
    Stefan Monnier authored
    * lisp/help-fns.el (describe-symbol-backends): Move to help-mode.el.
    (describe-symbol): Improve the selection of default.
    
    * lisp/help-mode.el: Require cl-lib.
    (describe-symbol-backends): Move from help-fns.el.
    (help-make-xrefs): Use it.
    
    * lisp/emacs-lisp/cl-extra.el (describe-symbol-backends): Add entry
    for types.
    (cl--typedef-regexp): New const.
    (find-function-regexp-alist): Add entry for types.
    (cl-help-type, cl-type-definition): New buttons.
    (cl-find-class): New function.
    (cl-describe-type): New command.
    (cl--describe-class, cl--describe-class-slot)
    (cl--describe-class-slots): New functions, moved from eieio-opt.el.
    
    * lisp/emacs-lisp/cl-generic.el (cl--generic-method-documentation)
    (cl--generic-all-functions, cl--generic-specializers-apply-to-type-p):
    New functions.  Moved from eieio-opt.el.
    (cl--generic-class-parents): New function, extracted from
    cl--generic-struct-specializers.
    (cl--generic-struct-specializers): Use it.
    
    * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use pcase-dolist.
    Improve constructor's docstrings.
    (cl-struct-unknown-slot): New error.
    (cl-struct-slot-offset): Use it.
    
    * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Record the type
    definition in current-load-list.
    
    * lisp/emacs-lisp/eieio-core.el (eieio--known-slot-names): New var.
    (eieio--add-new-slot): Set it.
    (eieio-defclass-internal): Use new name for current-load-list.
    (eieio-oref): Add compiler-macro to warn about unknown slots.
    * lisp/emacs-lisp/eieio.el (defclass): Update eieio--known-slot-names
    as compile-time as well.  Improve constructor docstrings.
    
    * lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
    (eieio--help-print-slot, eieio-help-class-slots): Move to cl-extra.el.
    (eieio-class-def): Remove button.
    (eieio-help-constructor): Use new name for load-history element.
    (eieio--specializers-apply-to-class-p, eieio-all-generic-functions)
    (eieio-method-documentation): Move to cl-generic.el.
    (eieio-display-method-list): Use new names.
    
    * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression):
    Add "define-linline".
    (lisp-fdefs): Remove "defsubst".
    (el-fdefs): Add "defsubst", "cl-defsubst", and "define-linline".
    
    * lisp/emacs-lisp/macroexp.el (macroexp--warned): New var.
    (macroexp--warn-and-return): Use it to avoid inf-loops.
    Add `compile-only' argument.
    59b5723c
cl-extra.el 29.4 KB