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)
; 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))
(&rest ("cl-declare" &rest sexp)))
(def-edebug-spec cl-declarations-or-string
- (&or stringp cl-declarations))
+ (&or lambda-doc cl-declarations))
(def-edebug-spec cl-lambda-list
(([&rest arg]
(def-edebug-spec cl-lambda-expr
(&define ("lambda" cl-lambda-list
- ;;cl-declarations-or-string
- ;;[&optional ("interactive" interactive)]
+ cl-declarations-or-string
+ [&optional ("interactive" interactive)]
def-body)))
;; Redefine function-form to also match cl-function
(def-edebug-spec defvar (symbolp &optional form stringp))
(def-edebug-spec defun
- (&define name lambda-list
- [&optional stringp]
+ (&define name lambda-list lambda-doc
[&optional ("declare" &rest sexp)]
[&optional ("interactive" interactive)]
def-body))
(def-edebug-spec defmacro
;; FIXME: Improve `declare' so we can Edebug gv-expander and
;; gv-setter declarations.
- (&define name lambda-list [&optional stringp]
+ (&define name lambda-list lambda-doc
[&optional ("declare" &rest sexp)] def-body))
(def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list.
&optional ["&rest" arg]
)))
+(def-edebug-spec lambda-doc
+ (&optional [&or stringp
+ (&define ":documentation" def-form)]))
+
(def-edebug-spec interactive
(&optional &or stringp def-form))
instrument cannot be found, signal an error."
(let ((func-marker (get func 'edebug)))
(cond
- ((and (markerp func-marker) (marker-buffer func-marker))
- ;; It is uninstrumented, so instrument it.
- (with-current-buffer (marker-buffer func-marker)
- (goto-char func-marker)
- (edebug-eval-top-level-form)
- (list func)))
- ((consp func-marker)
- (message "%s is already instrumented." func)
- (list func))
((cl-generic-p func)
(let ((method-defs (cl--generic-method-files func))
symbols)
(edebug-eval-top-level-form)
(push (edebug-form-data-symbol) symbols))))
symbols))
+ ((and (markerp func-marker) (marker-buffer func-marker))
+ ;; It is uninstrumented, so instrument it.
+ (with-current-buffer (marker-buffer func-marker)
+ (goto-char func-marker)
+ (edebug-eval-top-level-form)
+ (list func)))
+ ((consp func-marker)
+ (message "%s is already instrumented." func)
+ (list func))
(t
(let ((loc (find-function-noselect func t)))
(unless (cdr loc)
When called as a function, NAME returns an iterator value that
encapsulates the state of a computation that produces a sequence
of values. Callers can retrieve each value using `iter-next'."
- (declare (indent defun))
+ (declare (indent defun)
+ (debug (&define name lambda-list lambda-doc def-body)))
(cl-assert lexical-binding)
(let* ((parsed-body (macroexp-parse-body body))
(declarations (car parsed-body))
(defmacro iter-lambda (arglist &rest body)
"Return a lambda generator.
`iter-lambda' is to `iter-defun' as `lambda' is to `defun'."
- (declare (indent defun))
+ (declare (indent defun)
+ (debug (&define lambda-list lambda-doc def-body)))
(cl-assert lexical-binding)
`(lambda ,arglist
,(cps-generate-evaluator body)))
formal argument can be any pattern accepted by `pcase' (a mere
variable name being but a special case of it)."
(declare (doc-string 2) (indent defun)
- (debug ((&rest pcase-PAT) body)))
+ (debug (&define (&rest pcase-PAT) lambda-doc def-body)))
(let* ((bindings ())
(parsed-body (macroexp-parse-body body))
(args (mapcar (lambda (pat)
\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"
(declare (doc-string 2) (indent defun)
- (debug (&define lambda-list
- [&optional stringp]
+ (debug (&define lambda-list lambda-doc
[&optional ("interactive" interactive)]
def-body)))
;; Note that this definition should not use backquotes; subr.el should not