summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/edebug.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-02-13 17:50:31 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-02-13 17:50:31 -0500
commit39a401ddae154b94e4c0e9c8ced1b27d9dc56daa (patch)
treeaa2204ba3ea26738f3ce021d152ab35c019049bf /lisp/emacs-lisp/edebug.el
parent68bd6f3ea9c05637501139c46f1f4304482db95f (diff)
downloademacs-39a401ddae154b94e4c0e9c8ced1b27d9dc56daa.tar.gz
* lisp/emacs-lisp/edebug.el (edebug-match-lambda-expr): Delete function
(lambda-expr): Define with `def-edebug-elem-spec` instead. (edebug--handle-&-spec-op): Remove left over code. (interactive): Re-add mistakenly removed spec elem. * doc/lispref/edebug.texi (Specification List): Remove `function-form`.
Diffstat (limited to 'lisp/emacs-lisp/edebug.el')
-rw-r--r--lisp/emacs-lisp/edebug.el36
1 files changed, 8 insertions, 28 deletions
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 867161e0280..1cc95f7ac8c 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1753,7 +1753,6 @@ contains a circular object."
(def-form . edebug-match-def-form)
;; Less frequently used:
;; (function . edebug-match-function)
- (lambda-expr . edebug-match-lambda-expr)
(cl-macrolet-expr . edebug-match-cl-macrolet-expr)
(cl-macrolet-name . edebug-match-cl-macrolet-name)
(cl-macrolet-body . edebug-match-cl-macrolet-body)
@@ -1873,7 +1872,7 @@ and then matches the rest against the output of (FUN ARGS... HEAD)."
(pcase-let*
((`(,spec ,fun . ,args) specs)
(exps (edebug-cursor-expressions cursor))
- (instrumented-head (edebug-match-one-spec cursor (or spec 'sexp)))
+ (instrumented-head (edebug-match-one-spec cursor spec))
(consumed (- (length exps)
(length (edebug-cursor-expressions cursor))))
(newspecs (apply fun (append args (seq-subseq exps 0 consumed)))))
@@ -2026,32 +2025,6 @@ and then matches the rest against the output of (FUN ARGS... HEAD)."
offsets)
specs))
-(defun edebug-match-lambda-expr (cursor)
- ;; The expression must be a function.
- ;; This will match any list form that begins with a symbol
- ;; that has an edebug-form-spec beginning with &define. In
- ;; practice, only lambda expressions should be used.
- ;; I could add a &lambda specification to avoid confusion.
- (let* ((sexp (edebug-top-element-required
- cursor "Expected lambda expression"))
- (offset (edebug-top-offset cursor))
- (head (and (consp sexp) (car sexp)))
- (spec (and (symbolp head) (edebug-get-spec head)))
- (edebug-inside-func nil))
- ;; Find out if this is a defining form from first symbol.
- (if (and (consp spec) (eq '&define (car spec)))
- (prog1
- (list
- (edebug-defining-form
- (edebug-new-cursor sexp offset)
- (car offset);; before the sexp
- (edebug-after-offset cursor)
- (cons (symbol-name head) (cdr spec))))
- (edebug-move-cursor cursor))
- (edebug-no-match cursor "Expected lambda expression")
- )))
-
-
(cl-defmethod edebug--handle-&-spec-op ((_ (eql &name)) cursor specs)
"Compute the name for `&name SPEC FUN` spec operator.
@@ -2271,12 +2244,19 @@ into `edebug--cl-macrolet-defs' which is checked in `edebug-list-form-args'."
&optional ["&rest" arg]
)))
+(def-edebug-elem-spec 'lambda-expr
+ '(("lambda" &define lambda-list lambda-doc
+ [&optional ("interactive" interactive)]
+ def-body)))
+
(def-edebug-elem-spec 'arglist '(lambda-list)) ;; deprecated - use lambda-list.
(def-edebug-elem-spec 'lambda-doc
'(&optional [&or stringp
(&define ":documentation" def-form)]))
+(def-edebug-elem-spec 'interactive '(&optional &or stringp def-form))
+
;; A function-form is for an argument that may be a function or a form.
;; This specially recognizes anonymous functions quoted with quote.
(def-edebug-elem-spec 'function-form ;Deprecated, use `form'!