unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Gildea <stepheng+emacs@gildea.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: (declare (debug 0))
Date: Wed, 20 Oct 2021 18:46:34 -0700	[thread overview]
Message-ID: <108015.1634780794@pental> (raw)
In-Reply-To: Message from monnier@iro.umontreal.ca of 20 Oct 2021 08:33:34 -0400 <jwvsfwvq3kx.fsf-monnier+emacs@gnu.org>

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	other threads:[~2021-10-21  1:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  1:40 (declare (debug 0)) Stephen Gildea
2021-10-19 12:29 ` Stefan Monnier
2021-10-20  5:22   ` Stephen Gildea
2021-10-20 12:33     ` Stefan Monnier
2021-10-21  1:46       ` Stephen Gildea [this message]
2021-10-21 16:44         ` Stefan Monnier
2021-10-21 17:10           ` Eli Zaretskii
2021-10-21 19:04             ` Stephen Gildea
2021-10-21 19:17               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=108015.1634780794@pental \
    --to=stepheng+emacs@gildea.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).