]> git.eshelyaron.com Git - emacs.git/commit
(interactive-form, function-docstring): New generic functions
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 17 Dec 2021 04:58:17 +0000 (23:58 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 17 Dec 2021 04:58:17 +0000 (23:58 -0500)
commitd93b0ad4d4ad5c3704aec56ee22b35daae7a9867
tree25c439c2f5f3ad0ff5953a64b031adea4b6aff2e
parentae0bfc4f758b47359e4ce8997781222b34795dfb
(interactive-form, function-docstring): New generic functions

Change `interactive-form` to be a generic function, and
change `documentation` to delegate to a new `function-docstring`
generic function so that we can use `cl-defmethod` to construct
the docstrings and interactive forms of OClosures.

* src/eval.c (Fcommandp): Rewrite to delegate to `interactive-form`
when potentially necessary.

* src/doc.c (Fdocumentation): Delegate to `function-docstring` in
most cases.

* src/data.c (Finternal__interactive_form): Rename from
`Finteractive_form` and simplify to only handle the cases we can't (yet)
handle from Lisp.
(syms_of_data): Adjust accordingly.

* src/callint.c (Fcall_interactively): `interactive-form` is now
defined in Lisp.

* lisp/simple.el: Require `subr-x`.
(function-docstring, interactive-form): New generic functions.

* lisp/loadup.el ("simple"): Postpone loading it after `cl-generic`.

* lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load):
Don't neuter eager macroexpansion errors.

* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda):
Avoid `interactive-form` to avoid breaking bootstrap since it's now
defined as a generic function.
(cl-defmethod): Simplify.
(cl--generic-compiler): New var.
(cl--generic-get-dispatcher): Use it.
(cl--generic-prefill-dispatchers): Rebind it.
15 files changed:
lisp/ansi-color.el
lisp/cus-edit.el
lisp/cus-theme.el
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/macroexp.el
lisp/emacs-lisp/syntax.el
lisp/emacs-lisp/tabulated-list.el
lisp/files.el
lisp/ido.el
lisp/loadup.el
lisp/simple.el
src/callint.c
src/data.c
src/doc.c
src/eval.c