emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (declare (debug 0))


From: Stephen Gildea
Subject: Re: (declare (debug 0))
Date: Wed, 20 Oct 2021 18:46:34 -0700

Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>   In my experience, macros whose args should not be instrumented are not
>   the most common, by far, and (&rest sexp) is sufficiently short and
>   clear for them.  I don't see any need to have something shorter.

Then how about the following update to the documentation.  This
removes "0" as a recommended shortcut and instead adds a "not
instrumented" example.


diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index 323130f237..7d67cc3af1 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -1216,9 +1216,7 @@ Instrumenting Macro Calls
 @table @asis
 @item @code{t}
 All arguments are instrumented for evaluation.
-
-@item @code{0}
-None of the arguments is instrumented.
+This is short for @code{(body)}.
 
 @item a symbol
 The symbol must have an Edebug specification, which is used instead.
@@ -1528,6 +1526,16 @@ Specification Examples
 It may be easier to understand Edebug specifications by studying
 the examples provided here.
 
+Consider a hypothetical macro @code{my-test-generator} that runs
+tests on supplied lists of data.  Although it is Edebug's default
+behavior to not instrument arguments as code, as controlled by
+@code{edebug-eval-macro-args} (@pxref{Instrumenting Macro Calls}),
+it can be useful to explicitly document that the arguments are data:
+
+@example
+(def-edebug-spec my-test-generator (&rest sexp))
+@end example
+
 A @code{let} special form has a sequence of bindings and a body.  Each
 of the bindings is either a symbol or a sublist with a symbol and
 optional expression.  In the specification below, notice the @code{gate}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]