aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/cl-generic.el13
-rw-r--r--lisp/emacs-lisp/cl-macs.el6
-rw-r--r--lisp/emacs-lisp/edebug.el27
-rw-r--r--lisp/emacs-lisp/generator.el6
-rw-r--r--lisp/emacs-lisp/pcase.el2
-rw-r--r--lisp/subr.el3
6 files changed, 35 insertions, 22 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:
204DEFAULT-BODY, if present, is used as the body of a default method. 204DEFAULT-BODY, if present, is used as the body of a default method.
205 205
206\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)" 206\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)"
207 (declare (indent 2) (doc-string 3)) 207 (declare (indent 2) (doc-string 3)
208 (debug
209 (&define name cl-lambda-list lambda-doc
210 [&rest [&or
211 ("declare" &rest sexp)
212 (":argument-precedence-order" &rest sexp)
213 (&define ":method" [&rest atom]
214 cl-generic-method-args lambda-doc
215 def-body)]]
216 def-body)))
208 (let* ((doc (if (stringp (car-safe options-and-methods)) 217 (let* ((doc (if (stringp (car-safe options-and-methods))
209 (pop options-and-methods))) 218 (pop options-and-methods)))
210 (declarations nil) 219 (declarations nil)
@@ -422,7 +431,7 @@ The set of acceptable TYPEs (also called \"specializers\") is defined
422 ; Like in CLOS spec, we support 431 ; Like in CLOS spec, we support
423 ; any non-list values. 432 ; any non-list values.
424 cl-generic-method-args ; arguments 433 cl-generic-method-args ; arguments
425 [ &optional stringp ] ; documentation string 434 lambda-doc ; documentation string
426 def-body))) ; part to be debugged 435 def-body))) ; part to be debugged
427 (let ((qualifiers nil)) 436 (let ((qualifiers nil))
428 (while (not (listp args)) 437 (while (not (listp args))
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 32ba0ac3091..40eda1e0d65 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -190,7 +190,7 @@ The name is made by appending a number to PREFIX, default \"T\"."
190 (&rest ("cl-declare" &rest sexp))) 190 (&rest ("cl-declare" &rest sexp)))
191 191
192(def-edebug-spec cl-declarations-or-string 192(def-edebug-spec cl-declarations-or-string
193 (&or stringp cl-declarations)) 193 (&or lambda-doc cl-declarations))
194 194
195(def-edebug-spec cl-lambda-list 195(def-edebug-spec cl-lambda-list
196 (([&rest arg] 196 (([&rest arg]
@@ -447,8 +447,8 @@ more details.
447 447
448(def-edebug-spec cl-lambda-expr 448(def-edebug-spec cl-lambda-expr
449 (&define ("lambda" cl-lambda-list 449 (&define ("lambda" cl-lambda-list
450 ;;cl-declarations-or-string 450 cl-declarations-or-string
451 ;;[&optional ("interactive" interactive)] 451 [&optional ("interactive" interactive)]
452 def-body))) 452 def-body)))
453 453
454;; Redefine function-form to also match cl-function 454;; Redefine function-form to also match cl-function
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index dbc56e272fd..d00b14e803e 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1986,15 +1986,14 @@ expressions; a `progn' form will be returned enclosing these forms."
1986(def-edebug-spec defvar (symbolp &optional form stringp)) 1986(def-edebug-spec defvar (symbolp &optional form stringp))
1987 1987
1988(def-edebug-spec defun 1988(def-edebug-spec defun
1989 (&define name lambda-list 1989 (&define name lambda-list lambda-doc
1990 [&optional stringp]
1991 [&optional ("declare" &rest sexp)] 1990 [&optional ("declare" &rest sexp)]
1992 [&optional ("interactive" interactive)] 1991 [&optional ("interactive" interactive)]
1993 def-body)) 1992 def-body))
1994(def-edebug-spec defmacro 1993(def-edebug-spec defmacro
1995 ;; FIXME: Improve `declare' so we can Edebug gv-expander and 1994 ;; FIXME: Improve `declare' so we can Edebug gv-expander and
1996 ;; gv-setter declarations. 1995 ;; gv-setter declarations.
1997 (&define name lambda-list [&optional stringp] 1996 (&define name lambda-list lambda-doc
1998 [&optional ("declare" &rest sexp)] def-body)) 1997 [&optional ("declare" &rest sexp)] def-body))
1999 1998
2000(def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. 1999(def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list.
@@ -2005,6 +2004,10 @@ expressions; a `progn' form will be returned enclosing these forms."
2005 &optional ["&rest" arg] 2004 &optional ["&rest" arg]
2006 ))) 2005 )))
2007 2006
2007(def-edebug-spec lambda-doc
2008 (&optional [&or stringp
2009 (&define ":documentation" def-form)]))
2010
2008(def-edebug-spec interactive 2011(def-edebug-spec interactive
2009 (&optional &or stringp def-form)) 2012 (&optional &or stringp def-form))
2010 2013
@@ -3204,15 +3207,6 @@ generated symbols for methods. If a function or method to
3204instrument cannot be found, signal an error." 3207instrument cannot be found, signal an error."
3205 (let ((func-marker (get func 'edebug))) 3208 (let ((func-marker (get func 'edebug)))
3206 (cond 3209 (cond
3207 ((and (markerp func-marker) (marker-buffer func-marker))
3208 ;; It is uninstrumented, so instrument it.
3209 (with-current-buffer (marker-buffer func-marker)
3210 (goto-char func-marker)
3211 (edebug-eval-top-level-form)
3212 (list func)))
3213 ((consp func-marker)
3214 (message "%s is already instrumented." func)
3215 (list func))
3216 ((cl-generic-p func) 3210 ((cl-generic-p func)
3217 (let ((method-defs (cl--generic-method-files func)) 3211 (let ((method-defs (cl--generic-method-files func))
3218 symbols) 3212 symbols)
@@ -3227,6 +3221,15 @@ instrument cannot be found, signal an error."
3227 (edebug-eval-top-level-form) 3221 (edebug-eval-top-level-form)
3228 (push (edebug-form-data-symbol) symbols)))) 3222 (push (edebug-form-data-symbol) symbols))))
3229 symbols)) 3223 symbols))
3224 ((and (markerp func-marker) (marker-buffer func-marker))
3225 ;; It is uninstrumented, so instrument it.
3226 (with-current-buffer (marker-buffer func-marker)
3227 (goto-char func-marker)
3228 (edebug-eval-top-level-form)
3229 (list func)))
3230 ((consp func-marker)
3231 (message "%s is already instrumented." func)
3232 (list func))
3230 (t 3233 (t
3231 (let ((loc (find-function-noselect func t))) 3234 (let ((loc (find-function-noselect func t)))
3232 (unless (cdr loc) 3235 (unless (cdr loc)
diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el
index 3e9885900cf..410e4edcc92 100644
--- a/lisp/emacs-lisp/generator.el
+++ b/lisp/emacs-lisp/generator.el
@@ -680,7 +680,8 @@ sub-iterator function returns via `iter-end-of-sequence'."
680When called as a function, NAME returns an iterator value that 680When called as a function, NAME returns an iterator value that
681encapsulates the state of a computation that produces a sequence 681encapsulates the state of a computation that produces a sequence
682of values. Callers can retrieve each value using `iter-next'." 682of values. Callers can retrieve each value using `iter-next'."
683 (declare (indent defun)) 683 (declare (indent defun)
684 (debug (&define name lambda-list lambda-doc def-body)))
684 (cl-assert lexical-binding) 685 (cl-assert lexical-binding)
685 (let* ((parsed-body (macroexp-parse-body body)) 686 (let* ((parsed-body (macroexp-parse-body body))
686 (declarations (car parsed-body)) 687 (declarations (car parsed-body))
@@ -692,7 +693,8 @@ of values. Callers can retrieve each value using `iter-next'."
692(defmacro iter-lambda (arglist &rest body) 693(defmacro iter-lambda (arglist &rest body)
693 "Return a lambda generator. 694 "Return a lambda generator.
694`iter-lambda' is to `iter-defun' as `lambda' is to `defun'." 695`iter-lambda' is to `iter-defun' as `lambda' is to `defun'."
695 (declare (indent defun)) 696 (declare (indent defun)
697 (debug (&define lambda-list lambda-doc def-body)))
696 (cl-assert lexical-binding) 698 (cl-assert lexical-binding)
697 `(lambda ,arglist 699 `(lambda ,arglist
698 ,(cps-generate-evaluator body))) 700 ,(cps-generate-evaluator body)))
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index c703cae4458..36af88423c8 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -226,7 +226,7 @@ I.e. accepts the usual &optional and &rest keywords, but every
226formal argument can be any pattern accepted by `pcase' (a mere 226formal argument can be any pattern accepted by `pcase' (a mere
227variable name being but a special case of it)." 227variable name being but a special case of it)."
228 (declare (doc-string 2) (indent defun) 228 (declare (doc-string 2) (indent defun)
229 (debug ((&rest pcase-PAT) body))) 229 (debug (&define (&rest pcase-PAT) lambda-doc def-body)))
230 (let* ((bindings ()) 230 (let* ((bindings ())
231 (parsed-body (macroexp-parse-body body)) 231 (parsed-body (macroexp-parse-body body))
232 (args (mapcar (lambda (pat) 232 (args (mapcar (lambda (pat)
diff --git a/lisp/subr.el b/lisp/subr.el
index d2fefe04f8a..c216877ce5f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -110,8 +110,7 @@ BODY should be a list of Lisp expressions.
110 110
111\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)" 111\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"
112 (declare (doc-string 2) (indent defun) 112 (declare (doc-string 2) (indent defun)
113 (debug (&define lambda-list 113 (debug (&define lambda-list lambda-doc
114 [&optional stringp]
115 [&optional ("interactive" interactive)] 114 [&optional ("interactive" interactive)]
116 def-body))) 115 def-body)))
117 ;; Note that this definition should not use backquotes; subr.el should not 116 ;; Note that this definition should not use backquotes; subr.el should not