help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: instrumenting forms in defmacro with edebug


From: Alan
Subject: Re: instrumenting forms in defmacro with edebug
Date: Wed, 28 Mar 2012 19:16:39 -0000
User-agent: G2/1.0

On Jun 1, 1:24 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > I may be overlooking something in using edebug, so I'll check with
> > experts here to learn if I am.
>
> No, you're not overlooking anything.
>
> > Am I overlooking some feature of edebug that would instrument form1,
> > form2 and form3 more directly?
>
> Edebug provides the ability to step through the forms of the macro
> calls, but stepping through the forms of the macro-expanded code is
> trickier.  You can use
>
> (defmacro macro_name (arg1 &rest body)
>   (declare (debug t))
>   (edebug-\`
>    (let (var1 var2)
>      (form1)
>      (form2)
>      ,@body
>      (form3))))
>
> which may work (if you edebug-eval the defmacro), and if so will make you
> step both through the macro expansion and through the evaluation of the
> macro-expanded code.
>
>         Stefan

I may be suffering from thick-headedness, but I gave your suggestion a
try and couldn't make it work.  There are several things I don't
understand from your suggestion.  I don't understand "(edebug-\`".
"edebug" is a function, but on this line it is followed by a dash and
then "\`".  The closing ")" is on the last line of the "(defmacro"
construct.  I tried a number of variations on your suggestion, but it
seems that using "edebug-eval-defun" always complains about ",@" when
the "`" backquote character is in the line ahead of "(let".

I provided a pseudo macro--for illustrative purposes--but I am
actually trying your suggestion with my real macro.


reply via email to

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