diff options
author | Gemini Lasswell <gazally@runbox.com> | 2017-10-06 11:30:22 -0700 |
---|---|---|
committer | Gemini Lasswell <gazally@runbox.com> | 2017-10-06 11:31:12 -0700 |
commit | 238fbcb20e9281fc44f4029f52cf31e0dc5b6281 (patch) | |
tree | 0d9c6e9429fbb8fe43548135b1cb9b84db2161bd /lisp/emacs-lisp/cl-generic.el | |
parent | 2d58d513290f08819699e933bb0fbe88362c2131 (diff) | |
download | emacs-238fbcb20e9281fc44f4029f52cf31e0dc5b6281.tar.gz |
Create new Edebug spec for docstrings and use it in closures
Since (:documentation FORM) can be used to create a docstring
when lexical-binding is on, allow for that possibility in Edebug
specs (bug#24773).
* lisp/emacs-lisp/edebug.el: Define an Edebug spec for docstrings
called lambda-doc and modify the Edebug specs for defun and
defmacro to use it.
(edebug-instrument-function): Check for generic functions first,
to fix bug where edebug-step-in didn't work on methods now that
cl-defgeneric has an Edebug spec.
* lisp/subr.el (lambda): Modify Edebug spec to use lambda-doc.
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add Edebug spec
(bug#27747).
(cl-defmethod): Use lambda-doc in Edebug spec.
* lisp/emacs-lisp/cl-macs.el: Modify Edebug spec for
cl-declarations-or-string to use lambda-doc, and modify Edebug
spec for cl-lambda-expr to use cl-declarations-or-string.
* lisp/emacs-lisp/pcase.el (pcase-lambda): Modify Edebug spec to
use lambda-doc, as well as &define and def-body which are
necessary for using Edebug on code wrapped by lambda.
* lisp/emacs-lisp/generator.el (iter-defun, iter-lambda): Add
Edebug specs.
Diffstat (limited to 'lisp/emacs-lisp/cl-generic.el')
-rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index b2f76abd88e..62befd4742a 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -204,7 +204,16 @@ OPTIONS-AND-METHODS currently understands: DEFAULT-BODY, if present, is used as the body of a default method. \(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)" - (declare (indent 2) (doc-string 3)) + (declare (indent 2) (doc-string 3) + (debug + (&define name cl-lambda-list lambda-doc + [&rest [&or + ("declare" &rest sexp) + (":argument-precedence-order" &rest sexp) + (&define ":method" [&rest atom] + cl-generic-method-args lambda-doc + def-body)]] + def-body))) (let* ((doc (if (stringp (car-safe options-and-methods)) (pop options-and-methods))) (declarations nil) @@ -422,7 +431,7 @@ The set of acceptable TYPEs (also called \"specializers\") is defined ; Like in CLOS spec, we support ; any non-list values. cl-generic-method-args ; arguments - [ &optional stringp ] ; documentation string + lambda-doc ; documentation string def-body))) ; part to be debugged (let ((qualifiers nil)) (while (not (listp args)) |