From: Gemini Lasswell <geminilasswell@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Gemini Lasswell <gazally@runbox.com>, 29048@debbugs.gnu.org
Subject: bug#29048: 26.0.90; [PATCH] Improve documentation on Edebug and macros
Date: Thu, 09 Nov 2017 09:43:01 -0800 [thread overview]
Message-ID: <87r2t71h7e.fsf@runbox.com> (raw)
In-Reply-To: <83mv43v5rn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Nov 2017 15:41:32 +0200")
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
> That's okay, but please mention eval-when-compile as an example of the
> broader class of situations with instrumenting code wrapped with
> macros.
OK, here's a revised version.
[-- Attachment #2: 0001-Improve-documentation-of-Edebug-and-macros.patch --]
[-- Type: text/plain, Size: 3509 bytes --]
From 4213f586b8207bc0529c664ada005bfc61acfa08 Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally@runbox.com>
Date: Sat, 28 Oct 2017 13:47:15 -0700
Subject: [PATCH] Improve documentation of Edebug and macros
* doc/lispref/edebug.texi (Instrumenting Macro Calls): Improve
discussion of when it might be necessary to find and evaluate macro
specifications before instrumenting.
(Specification List): Clarify what "defining form" means to Edebug
and when 'def-form' or 'def-body' should be used instead of 'form'
or 'body'.
---
doc/lispref/edebug.texi | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index cebf0a3af3..62fd9f38cb 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -1144,9 +1144,12 @@ Instrumenting Macro Calls
@c automatically load the entire source file containing the function
@c being instrumented. That would avoid this.
Take care to ensure that the specifications are known to Edebug when
-you instrument code. If you are instrumenting a function from a file
-that uses @code{eval-when-compile} to require another file containing
-macro definitions, you may need to explicitly load that file.
+you instrument code. If you are instrumenting a function which uses a
+macro defined in another file, you may first need to either evaluate
+the @code{require} forms in the file containing your function, or
+explicitly load the file containing the macro. If the definition of a
+macro is wrapped by @code{eval-when-compile}, you may need to evaluate
+it.
You can also define an edebug specification for a macro separately
from the macro definition with @code{def-edebug-spec}. Adding
@@ -1231,13 +1234,17 @@ Specification List
@c an "expression" is not necessarily intended for evaluation.
@item form
-A single evaluated expression, which is instrumented.
+A single evaluated expression, which is instrumented. If your macro
+wraps the expression with @code{lambda} before it is evaluated, use
+@code{def-form} instead. See @code{def-form} below.
@item place
A generalized variable. @xref{Generalized Variables}.
@item body
-Short for @code{&rest form}. See @code{&rest} below.
+Short for @code{&rest form}. See @code{&rest} below. If your macro
+wraps its body of code with @code{lambda} before it is evaluated, use
+@code{def-body} instead. See @code{def-body} below.
@item function-form
A function form: either a quoted function symbol, a quoted lambda
@@ -1292,11 +1299,16 @@ Specification List
@item &define
@c @kindex &define @r{(Edebug)}
-Indicates that the specification is for a defining form. The defining
-form itself is not instrumented (that is, Edebug does not stop before and
-after the defining form), but forms inside it typically will be
-instrumented. The @code{&define} keyword should be the first element in
-a list specification.
+
+Indicates that the specification is for a defining form. Edebug's
+definition of a defining form is a form containing one or more code
+forms which are saved and executed later, after the execution of the
+defining form.
+
+The defining form itself is not instrumented (that is, Edebug does not
+stop before and after the defining form), but forms inside it
+typically will be instrumented. The @code{&define} keyword should be
+the first element in a list specification.
@item nil
This is successful when there are no more arguments to match at the
--
2.14.3
next prev parent reply other threads:[~2017-11-09 17:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-29 1:01 bug#29048: 26.0.90; [PATCH] Improve documentation on Edebug and macros Gemini Lasswell
2017-11-03 13:41 ` Eli Zaretskii
2017-11-09 17:43 ` Gemini Lasswell [this message]
2017-11-09 20:15 ` Eli Zaretskii
2017-11-13 23:42 ` Gemini Lasswell
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=87r2t71h7e.fsf@runbox.com \
--to=geminilasswell@runbox.com \
--cc=29048@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=gazally@runbox.com \
/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).