GNU Info

Info Node: (elisp)Instrumenting Macro Calls

(elisp)Instrumenting Macro Calls


Next: Edebug Options Prev: The Outside Context Up: Edebug
Enter node , (file) or (file)node

Instrumenting Macro Calls
-------------------------

   When Edebug instruments an expression that calls a Lisp macro, it
needs additional information about the macro to do the job properly.
This is because there is no a-priori way to tell which subexpressions
of the macro call are forms to be evaluated.  (Evaluation may occur
explicitly in the macro body, or when the resulting expansion is
evaluated, or any time later.)

   Therefore, you must define an Edebug specification for each macro
that Edebug will encounter, to explain the format of calls to that
macro.  To do this, use `def-edebug-spec'.

 - Macro: def-edebug-spec macro specification
     Specify which expressions of a call to macro MACRO are forms to be
     evaluated.  For simple macros, the SPECIFICATION often looks very
     similar to the formal argument list of the macro definition, but
     specifications are much more general than macro arguments.

     The MACRO argument can actually be any symbol, not just a macro
     name.

   Here is a simple example that defines the specification for the
`for' example macro (Note: Argument Evaluation), followed by an
alternative, equivalent specification.

     (def-edebug-spec for
       (symbolp "from" form "to" form "do" &rest form))
     
     (def-edebug-spec for
       (symbolp ['from form] ['to form] ['do body]))

   Here is a table of the possibilities for SPECIFICATION and how each
directs processing of arguments.

`t'
     All arguments are instrumented for evaluation.

`0'
     None of the arguments is instrumented.

a symbol
     The symbol must have an Edebug specification which is used instead.
     This indirection is repeated until another kind of specification is
     found.  This allows you to inherit the specification from another
     macro.

a list
     The elements of the list describe the types of the arguments of a
     calling form.  The possible elements of a specification list are
     described in the following sections.

Specification List
How to specify complex patterns of evaluation.
Backtracking
What Edebug does when matching fails.
Specification Examples
To help understand specifications.

automatically generated by info2www version 1.2.2.9