1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Improve the documentation of :extra in cl-defmethod

* doc/lispref/functions.texi (Generic Functions): Improve
documentation of :extra (bug#46917).

* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Ditto.
This commit is contained in:
Lars Ingebrigtsen 2021-03-05 14:27:08 +01:00
parent 51e78e9146
commit 1b30431c0e
2 changed files with 12 additions and 7 deletions

View file

@ -455,8 +455,12 @@ all methods of NAME have to use the same set of arguments for dispatch.
Each dispatch argument and TYPE are specified in ARGS where the corresponding
formal argument appears as (VAR TYPE) rather than just VAR.
The optional second argument QUALIFIER is a specifier that
modifies how the method is combined with other methods, including:
The optional EXTRA element, on the form `:extra STRING', allows
you to add more methods for the same specializers and qualifiers.
These are distinguished by STRING.
The optional argument QUALIFIER is a specifier that modifies how
the method is combined with other methods, including:
:before - Method will be called before the primary
:after - Method will be called after the primary
:around - Method will be called around everything else
@ -473,7 +477,7 @@ method to be applicable.
The set of acceptable TYPEs (also called \"specializers\") is defined
\(and can be extended) by the various methods of `cl-generic-generalizers'.
\(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)"
\(fn NAME [EXTRA] [QUALIFIER] ARGS &rest [DOCSTRING] BODY)"
(declare (doc-string cl--defmethod-doc-pos) (indent defun)
(debug
(&define ; this means we are defining something