diff options
| author | Glenn Morris | 2009-07-15 03:09:52 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-07-15 03:09:52 +0000 |
| commit | 622fa3800bdde278eaedcfae81f4a3c6b02cc476 (patch) | |
| tree | bc13a6c34fca08f2b9284f2585fd9084d8afa1eb | |
| parent | 2066b4fe21ed0e925edbc3eff9ebf37be74ee77e (diff) | |
| download | emacs-622fa3800bdde278eaedcfae81f4a3c6b02cc476.tar.gz emacs-622fa3800bdde278eaedcfae81f4a3c6b02cc476.zip | |
Minor re-phrasings throughout.
(Edebug Execution Modes): Sit-for affects continue mode too.
(Jumping): Use `forward-sexp' rather than its keybinding.
(Edebug Misc): Fix Q binding.
(Edebug Eval): Remove cl version.
(Printing in Edebug): Clarify print-length etc.
(Instrumenting Macro Calls): Defopt edebug-eval-macro-args.
(Specification List): Remove edebug-unwrap findex entry.
(Specification Examples): defmacro is actually not the same as defun.
Escape "`" in example.
| -rw-r--r-- | doc/lispref/ChangeLog | 13 | ||||
| -rw-r--r-- | doc/lispref/edebug.texi | 147 |
2 files changed, 93 insertions, 67 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 226e03fc5b8..f0e57f6d529 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2009-07-15 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * edebug.texi: Minor re-phrasings throughout. | ||
| 4 | (Edebug Execution Modes): Sit-for affects continue mode too. | ||
| 5 | (Jumping): Use `forward-sexp' rather than its keybinding. | ||
| 6 | (Edebug Misc): Fix Q binding. | ||
| 7 | (Edebug Eval): Remove cl version. | ||
| 8 | (Printing in Edebug): Clarify print-length etc. | ||
| 9 | (Instrumenting Macro Calls): Defopt edebug-eval-macro-args. | ||
| 10 | (Specification List): Remove edebug-unwrap findex entry. | ||
| 11 | (Specification Examples): defmacro is actually not the same as defun. | ||
| 12 | Escape "`" in example. | ||
| 13 | |||
| 1 | 2009-07-15 Chong Yidong <cyd@stupidchicken.com> | 14 | 2009-07-15 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 15 | ||
| 3 | * markers.texi (The Mark): Document optional arg to | 16 | * markers.texi (The Mark): Document optional arg to |
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index baed3f3c649..943bab416ef 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | @section Edebug | 14 | @section Edebug |
| 15 | @cindex Edebug debugging facility | 15 | @cindex Edebug debugging facility |
| 16 | 16 | ||
| 17 | Edebug is a source-level debugger for Emacs Lisp programs with which | 17 | Edebug is a source-level debugger for Emacs Lisp programs, with which |
| 18 | you can: | 18 | you can: |
| 19 | 19 | ||
| 20 | @itemize @bullet | 20 | @itemize @bullet |
| @@ -40,7 +40,7 @@ Automatically re-evaluate a list of expressions and | |||
| 40 | display their results each time Edebug updates the display. | 40 | display their results each time Edebug updates the display. |
| 41 | 41 | ||
| 42 | @item | 42 | @item |
| 43 | Output trace info on function enter and exit. | 43 | Output trace information on function calls and returns. |
| 44 | 44 | ||
| 45 | @item | 45 | @item |
| 46 | Stop when an error occurs. | 46 | Stop when an error occurs. |
| @@ -56,7 +56,7 @@ Obtain rudimentary coverage testing and frequency counts. | |||
| 56 | @end itemize | 56 | @end itemize |
| 57 | 57 | ||
| 58 | The first three sections below should tell you enough about Edebug to | 58 | The first three sections below should tell you enough about Edebug to |
| 59 | enable you to use it. | 59 | start using it. |
| 60 | 60 | ||
| 61 | @menu | 61 | @menu |
| 62 | * Using Edebug:: Introduction to use of Edebug. | 62 | * Using Edebug:: Introduction to use of Edebug. |
| @@ -188,7 +188,7 @@ instrument any top-level form regardless of the values of | |||
| 188 | (@code{edebug-instrument-callee}) instruments the definition of the | 188 | (@code{edebug-instrument-callee}) instruments the definition of the |
| 189 | function or macro called by the list form after point, if is not already | 189 | function or macro called by the list form after point, if is not already |
| 190 | instrumented. This is possible only if Edebug knows where to find the | 190 | instrumented. This is possible only if Edebug knows where to find the |
| 191 | source for that function; for this reading, after loading Edebug, | 191 | source for that function; for this reason, after loading Edebug, |
| 192 | @code{eval-region} records the position of every definition it | 192 | @code{eval-region} records the position of every definition it |
| 193 | evaluates, even if not instrumenting it. See also the @kbd{i} command | 193 | evaluates, even if not instrumenting it. See also the @kbd{i} command |
| 194 | (@pxref{Jumping}), which steps into the call after instrumenting the | 194 | (@pxref{Jumping}), which steps into the call after instrumenting the |
| @@ -199,7 +199,7 @@ function. | |||
| 199 | expressions, and other defining forms. However, Edebug cannot determine | 199 | expressions, and other defining forms. However, Edebug cannot determine |
| 200 | on its own what a user-defined macro will do with the arguments of a | 200 | on its own what a user-defined macro will do with the arguments of a |
| 201 | macro call, so you must provide that information using Edebug | 201 | macro call, so you must provide that information using Edebug |
| 202 | specifications; see @ref{Edebug and Macros}, for details. | 202 | specifications; for details, @pxref{Edebug and Macros}. |
| 203 | 203 | ||
| 204 | When Edebug is about to instrument code for the first time in a | 204 | When Edebug is about to instrument code for the first time in a |
| 205 | session, it runs the hook @code{edebug-setup-hook}, then sets it to | 205 | session, it runs the hook @code{edebug-setup-hook}, then sets it to |
| @@ -293,18 +293,18 @@ completely work: exiting from Edebug, to resume the program, loses track | |||
| 293 | of the keyboard macro. This is not easy to fix. Also, defining or | 293 | of the keyboard macro. This is not easy to fix. Also, defining or |
| 294 | executing a keyboard macro outside of Edebug does not affect commands | 294 | executing a keyboard macro outside of Edebug does not affect commands |
| 295 | inside Edebug. This is usually an advantage. See also the | 295 | inside Edebug. This is usually an advantage. See also the |
| 296 | @code{edebug-continue-kbd-macro} option (@pxref{Edebug Options}). | 296 | @code{edebug-continue-kbd-macro} option in @ref{Edebug Options}. |
| 297 | 297 | ||
| 298 | When you enter a new Edebug level, the initial execution mode comes | 298 | When you enter a new Edebug level, the initial execution mode comes |
| 299 | from the value of the variable @code{edebug-initial-mode}. | 299 | from the value of the variable @code{edebug-initial-mode} |
| 300 | (@xref{Edebug Options}.) By default, this specifies step mode. Note | 300 | (@pxref{Edebug Options}). By default, this specifies step mode. Note |
| 301 | that you may reenter the same Edebug level several times if, for | 301 | that you may reenter the same Edebug level several times if, for |
| 302 | example, an instrumented function is called several times from one | 302 | example, an instrumented function is called several times from one |
| 303 | command. | 303 | command. |
| 304 | 304 | ||
| 305 | @defopt edebug-sit-for-seconds | 305 | @defopt edebug-sit-for-seconds |
| 306 | This option specifies how many seconds to wait between execution steps | 306 | This option specifies how many seconds to wait between execution steps |
| 307 | in trace mode. The default is 1 second. | 307 | in trace mode or continue mode. The default is 1 second. |
| 308 | @end defopt | 308 | @end defopt |
| 309 | 309 | ||
| 310 | @node Jumping | 310 | @node Jumping |
| @@ -329,7 +329,7 @@ Run the program for one expression | |||
| 329 | (@code{edebug-forward-sexp}). | 329 | (@code{edebug-forward-sexp}). |
| 330 | 330 | ||
| 331 | @item o | 331 | @item o |
| 332 | Run the program until the end of the containing sexp. | 332 | Run the program until the end of the containing sexp (@code{edebug-step-out}). |
| 333 | 333 | ||
| 334 | @item i | 334 | @item i |
| 335 | Step into the function or macro called by the form after point. | 335 | Step into the function or macro called by the form after point. |
| @@ -340,22 +340,22 @@ location of point, using a temporary breakpoint. | |||
| 340 | 340 | ||
| 341 | The @kbd{f} command runs the program forward over one expression. More | 341 | The @kbd{f} command runs the program forward over one expression. More |
| 342 | precisely, it sets a temporary breakpoint at the position that | 342 | precisely, it sets a temporary breakpoint at the position that |
| 343 | @kbd{C-M-f} would reach, then executes in go mode so that the program | 343 | @code{forward-sexp} would reach, then executes in go mode so that |
| 344 | will stop at breakpoints. | 344 | the program will stop at breakpoints. |
| 345 | 345 | ||
| 346 | With a prefix argument @var{n}, the temporary breakpoint is placed | 346 | With a prefix argument @var{n}, the temporary breakpoint is placed |
| 347 | @var{n} sexps beyond point. If the containing list ends before @var{n} | 347 | @var{n} sexps beyond point. If the containing list ends before @var{n} |
| 348 | more elements, then the place to stop is after the containing | 348 | more elements, then the place to stop is after the containing |
| 349 | expression. | 349 | expression. |
| 350 | 350 | ||
| 351 | You must check that the position @kbd{C-M-f} finds is a place that the | 351 | You must check that the position @code{forward-sexp} finds is a place |
| 352 | program will really get to. In @code{cond}, for example, this may not | 352 | that the program will really get to. In @code{cond}, for example, |
| 353 | be true. | 353 | this may not be true. |
| 354 | 354 | ||
| 355 | For flexibility, the @kbd{f} command does @code{forward-sexp} starting | 355 | For flexibility, the @kbd{f} command does @code{forward-sexp} starting |
| 356 | at point, rather than at the stop point. If you want to execute one | 356 | at point, rather than at the stop point. If you want to execute one |
| 357 | expression @emph{from the current stop point}, first type @kbd{w}, to | 357 | expression @emph{from the current stop point}, first type @kbd{w} |
| 358 | move point there, and then type @kbd{f}. | 358 | (@code{edebug-where}) to move point there, and then type @kbd{f}. |
| 359 | 359 | ||
| 360 | The @kbd{o} command continues ``out of'' an expression. It places a | 360 | The @kbd{o} command continues ``out of'' an expression. It places a |
| 361 | temporary breakpoint at the end of the sexp containing point. If the | 361 | temporary breakpoint at the end of the sexp containing point. If the |
| @@ -398,7 +398,7 @@ debugging. | |||
| 398 | 398 | ||
| 399 | @item Q | 399 | @item Q |
| 400 | Like @kbd{q}, but don't stop even for protected code | 400 | Like @kbd{q}, but don't stop even for protected code |
| 401 | (@code{top-level-nonstop}). | 401 | (@code{edebug-top-level-nonstop}). |
| 402 | 402 | ||
| 403 | @item r | 403 | @item r |
| 404 | Redisplay the most recently known expression result in the echo area | 404 | Redisplay the most recently known expression result in the echo area |
| @@ -641,7 +641,8 @@ Evaluate expression @var{exp} in the context outside of Edebug | |||
| 641 | interference with the evaluation. | 641 | interference with the evaluation. |
| 642 | 642 | ||
| 643 | @item M-: @var{exp} @key{RET} | 643 | @item M-: @var{exp} @key{RET} |
| 644 | Evaluate expression @var{exp} in the context of Edebug itself. | 644 | Evaluate expression @var{exp} in the context of Edebug itself |
| 645 | (@code{eval-expression}). | ||
| 645 | 646 | ||
| 646 | @item C-x C-e | 647 | @item C-x C-e |
| 647 | Evaluate the expression before point, in the context outside of Edebug | 648 | Evaluate the expression before point, in the context outside of Edebug |
| @@ -651,8 +652,8 @@ Evaluate the expression before point, in the context outside of Edebug | |||
| 651 | @cindex lexical binding (Edebug) | 652 | @cindex lexical binding (Edebug) |
| 652 | Edebug supports evaluation of expressions containing references to | 653 | Edebug supports evaluation of expressions containing references to |
| 653 | lexically bound symbols created by the following constructs in | 654 | lexically bound symbols created by the following constructs in |
| 654 | @file{cl.el} (version 2.03 or later): @code{lexical-let}, | 655 | @file{cl.el}: @code{lexical-let}, @code{macrolet}, and |
| 655 | @code{macrolet}, and @code{symbol-macrolet}. | 656 | @code{symbol-macrolet}. |
| 656 | 657 | ||
| 657 | @node Eval List | 658 | @node Eval List |
| 658 | @subsection Evaluation List Buffer | 659 | @subsection Evaluation List Buffer |
| @@ -718,10 +719,10 @@ inserts comment lines so that each expression becomes its own group. | |||
| 718 | Thus, if you type @kbd{C-c C-u} again without changing the buffer text, | 719 | Thus, if you type @kbd{C-c C-u} again without changing the buffer text, |
| 719 | the evaluation list is effectively unchanged. | 720 | the evaluation list is effectively unchanged. |
| 720 | 721 | ||
| 721 | If an error occurs during an evaluation from the evaluation list, the | 722 | If an error occurs during an evaluation from the evaluation list, |
| 722 | error message is displayed in a string as if it were the result. | 723 | the error message is displayed in a string as if it were the result. |
| 723 | Therefore, expressions that use variables not currently valid do not | 724 | Therefore, expressions using variables that are not currently valid do |
| 724 | interrupt your debugging. | 725 | not interrupt your debugging. |
| 725 | 726 | ||
| 726 | Here is an example of what the evaluation list window looks like after | 727 | Here is an example of what the evaluation list window looks like after |
| 727 | several expressions have been added to it: | 728 | several expressions have been added to it: |
| @@ -769,10 +770,10 @@ list structure, you may get an error when Edebug attempts to print it. | |||
| 769 | 770 | ||
| 770 | One way to cope with circular structure is to set @code{print-length} | 771 | One way to cope with circular structure is to set @code{print-length} |
| 771 | or @code{print-level} to truncate the printing. Edebug does this for | 772 | or @code{print-level} to truncate the printing. Edebug does this for |
| 772 | you; it binds @code{print-length} and @code{print-level} to 50 if they | 773 | you; it binds @code{print-length} and @code{print-level} to the values |
| 773 | were @code{nil}. (Actually, the variables @code{edebug-print-length} | 774 | of the variables @code{edebug-print-length} and |
| 774 | and @code{edebug-print-level} specify the values to use within Edebug.) | 775 | @code{edebug-print-level} (so long as they have non-@code{nil} |
| 775 | @xref{Output Variables}. | 776 | values). @xref{Output Variables}. |
| 776 | 777 | ||
| 777 | @defopt edebug-print-length | 778 | @defopt edebug-print-length |
| 778 | If non-@code{nil}, Edebug binds @code{print-length} to this value while | 779 | If non-@code{nil}, Edebug binds @code{print-length} to this value while |
| @@ -876,7 +877,7 @@ conditions that each form has returned two different values. | |||
| 876 | 877 | ||
| 877 | Coverage testing makes execution slower, so it is only done if | 878 | Coverage testing makes execution slower, so it is only done if |
| 878 | @code{edebug-test-coverage} is non-@code{nil}. Frequency counting is | 879 | @code{edebug-test-coverage} is non-@code{nil}. Frequency counting is |
| 879 | performed for all execution of an instrumented function, even if the | 880 | performed for all executions of an instrumented function, even if the |
| 880 | execution mode is Go-nonstop, and regardless of whether coverage testing | 881 | execution mode is Go-nonstop, and regardless of whether coverage testing |
| 881 | is enabled. | 882 | is enabled. |
| 882 | 883 | ||
| @@ -891,12 +892,12 @@ information temporarily, only until you type another key. | |||
| 891 | This command displays the frequency count data for each line of the | 892 | This command displays the frequency count data for each line of the |
| 892 | current definition. | 893 | current definition. |
| 893 | 894 | ||
| 894 | The frequency counts appear as comment lines after each line of code, | 895 | It inserts frequency counts as comment lines after each line of code. |
| 895 | and you can undo all insertions with one @code{undo} command. The | 896 | You can undo all insertions with one @code{undo} command. The counts |
| 896 | counts appear under the @samp{(} before an expression or the @samp{)} | 897 | appear under the @samp{(} before an expression or the @samp{)} after |
| 897 | after an expression, or on the last character of a variable. To | 898 | an expression, or on the last character of a variable. To simplify |
| 898 | simplify the display, a count is not shown if it is equal to the | 899 | the display, a count is not shown if it is equal to the count of an |
| 899 | count of an earlier expression on the same line. | 900 | earlier expression on the same line. |
| 900 | 901 | ||
| 901 | The character @samp{=} following the count for an expression says that | 902 | The character @samp{=} following the count for an expression says that |
| 902 | the expression has returned the same value each time it was evaluated. | 903 | the expression has returned the same value each time it was evaluated. |
| @@ -954,8 +955,8 @@ program. | |||
| 954 | @itemize @bullet | 955 | @itemize @bullet |
| 955 | @item | 956 | @item |
| 956 | @code{max-lisp-eval-depth} and @code{max-specpdl-size} are both | 957 | @code{max-lisp-eval-depth} and @code{max-specpdl-size} are both |
| 957 | incremented once to reduce Edebug's impact on the stack. You could, | 958 | increased to reduce Edebug's impact on the stack. You could, however, |
| 958 | however, still run out of stack space when using Edebug. | 959 | still run out of stack space when using Edebug. |
| 959 | 960 | ||
| 960 | @item | 961 | @item |
| 961 | The state of keyboard macro execution is saved and restored. While | 962 | The state of keyboard macro execution is saved and restored. While |
| @@ -1011,7 +1012,7 @@ The value of point in each displayed buffer is saved and restored if | |||
| 1011 | 1012 | ||
| 1012 | @item | 1013 | @item |
| 1013 | The variables @code{overlay-arrow-position} and | 1014 | The variables @code{overlay-arrow-position} and |
| 1014 | @code{overlay-arrow-string} are saved and restored. So you can safely | 1015 | @code{overlay-arrow-string} are saved and restored, so you can safely |
| 1015 | invoke Edebug from the recursive edit elsewhere in the same buffer. | 1016 | invoke Edebug from the recursive edit elsewhere in the same buffer. |
| 1016 | 1017 | ||
| 1017 | @item | 1018 | @item |
| @@ -1103,7 +1104,7 @@ For example, (for i from 1 to 10 do (print i))." | |||
| 1103 | @end smallexample | 1104 | @end smallexample |
| 1104 | 1105 | ||
| 1105 | The Edebug specification says which parts of a call to the macro are | 1106 | The Edebug specification says which parts of a call to the macro are |
| 1106 | forms to be evaluated. For simple macros, the @var{specification} | 1107 | forms to be evaluated. For simple macros, the specification |
| 1107 | often looks very similar to the formal argument list of the macro | 1108 | often looks very similar to the formal argument list of the macro |
| 1108 | definition, but specifications are much more general than macro | 1109 | definition, but specifications are much more general than macro |
| 1109 | arguments. @xref{Defining Macros}, for more explanation of | 1110 | arguments. @xref{Defining Macros}, for more explanation of |
| @@ -1135,7 +1136,7 @@ All arguments are instrumented for evaluation. | |||
| 1135 | None of the arguments is instrumented. | 1136 | None of the arguments is instrumented. |
| 1136 | 1137 | ||
| 1137 | @item a symbol | 1138 | @item a symbol |
| 1138 | The symbol must have an Edebug specification which is used instead. | 1139 | The symbol must have an Edebug specification, which is used instead. |
| 1139 | This indirection is repeated until another kind of specification is | 1140 | This indirection is repeated until another kind of specification is |
| 1140 | found. This allows you to inherit the specification from another macro. | 1141 | found. This allows you to inherit the specification from another macro. |
| 1141 | 1142 | ||
| @@ -1145,12 +1146,16 @@ calling form. The possible elements of a specification list are | |||
| 1145 | described in the following sections. | 1146 | described in the following sections. |
| 1146 | @end table | 1147 | @end table |
| 1147 | 1148 | ||
| 1148 | @vindex edebug-eval-macro-args | ||
| 1149 | If a macro has no Edebug specification, neither through a @code{debug} | 1149 | If a macro has no Edebug specification, neither through a @code{debug} |
| 1150 | declaration nor through a @code{def-edebug-spec} call, the variable | 1150 | declaration nor through a @code{def-edebug-spec} call, the variable |
| 1151 | @code{edebug-eval-macro-args} comes into play. If it is @code{nil}, | 1151 | @code{edebug-eval-macro-args} comes into play. |
| 1152 | the default, none of the arguments is instrumented for evaluation. | 1152 | |
| 1153 | If it is non-@code{nil}, all arguments are instrumented. | 1153 | @defopt edebug-eval-macro-args |
| 1154 | This controls the way Edebug treats macro arguments with no explicit | ||
| 1155 | Edebug specification. If it is @code{nil} (the default), none of the | ||
| 1156 | arguments is instrumented for evaluation. Otherwise, all arguments | ||
| 1157 | are instrumented. | ||
| 1158 | @end defopt | ||
| 1154 | 1159 | ||
| 1155 | @node Specification List | 1160 | @node Specification List |
| 1156 | @subsubsection Specification List | 1161 | @subsubsection Specification List |
| @@ -1170,8 +1175,8 @@ levels. Specification keywords apply only to the remainder of the | |||
| 1170 | sublist or group they are contained in. | 1175 | sublist or group they are contained in. |
| 1171 | 1176 | ||
| 1172 | When a specification list involves alternatives or repetition, matching | 1177 | When a specification list involves alternatives or repetition, matching |
| 1173 | it against an actual macro call may require backtracking. | 1178 | it against an actual macro call may require backtracking. For more |
| 1174 | @xref{Backtracking}, for more details. | 1179 | details, @pxref{Backtracking}. |
| 1175 | 1180 | ||
| 1176 | Edebug specifications provide the power of regular expression matching, | 1181 | Edebug specifications provide the power of regular expression matching, |
| 1177 | plus some context-free grammar constructs: the matching of sublists with | 1182 | plus some context-free grammar constructs: the matching of sublists with |
| @@ -1191,7 +1196,8 @@ A single unevaluated Lisp object, which is not instrumented. | |||
| 1191 | A single evaluated expression, which is instrumented. | 1196 | A single evaluated expression, which is instrumented. |
| 1192 | 1197 | ||
| 1193 | @item place | 1198 | @item place |
| 1194 | @findex edebug-unwrap | 1199 | @c I can't see that this index entry is useful without any explanation. |
| 1200 | @c @findex edebug-unwrap | ||
| 1195 | A place to store a value, as in the Common Lisp @code{setf} construct. | 1201 | A place to store a value, as in the Common Lisp @code{setf} construct. |
| 1196 | 1202 | ||
| 1197 | @item body | 1203 | @item body |
| @@ -1275,11 +1281,11 @@ If the symbol has an Edebug specification, this @dfn{indirect | |||
| 1275 | specification} should be either a list specification that is used in | 1281 | specification} should be either a list specification that is used in |
| 1276 | place of the symbol, or a function that is called to process the | 1282 | place of the symbol, or a function that is called to process the |
| 1277 | arguments. The specification may be defined with @code{def-edebug-spec} | 1283 | arguments. The specification may be defined with @code{def-edebug-spec} |
| 1278 | just as for macros. See the @code{defun} example. | 1284 | just as for macros. See the @code{defun} example. |
| 1279 | 1285 | ||
| 1280 | Otherwise, the symbol should be a predicate. The predicate is called | 1286 | Otherwise, the symbol should be a predicate. The predicate is called |
| 1281 | with the argument and the specification fails if the predicate returns | 1287 | with the argument and the specification fails if the predicate returns |
| 1282 | @code{nil}. In either case, that argument is not instrumented. | 1288 | @code{nil}, and the argument is not instrumented. |
| 1283 | 1289 | ||
| 1284 | Some suitable predicates include @code{symbolp}, @code{integerp}, | 1290 | Some suitable predicates include @code{symbolp}, @code{integerp}, |
| 1285 | @code{stringp}, @code{vectorp}, and @code{atom}. | 1291 | @code{stringp}, @code{vectorp}, and @code{atom}. |
| @@ -1355,7 +1361,7 @@ within the definition. | |||
| 1355 | 1361 | ||
| 1356 | @item def-form | 1362 | @item def-form |
| 1357 | The argument is a single, highest-level form in a definition. This is | 1363 | The argument is a single, highest-level form in a definition. This is |
| 1358 | like @code{def-body}, except use this to match a single form rather than | 1364 | like @code{def-body}, except it is used to match a single form rather than |
| 1359 | a list of forms. As a special case, @code{def-form} also means that | 1365 | a list of forms. As a special case, @code{def-form} also means that |
| 1360 | tracing information is not output when the form is executed. See the | 1366 | tracing information is not output when the form is executed. See the |
| 1361 | @code{interactive} example. | 1367 | @code{interactive} example. |
| @@ -1374,15 +1380,15 @@ matched by some element in the specification, and every required element | |||
| 1374 | in the specification must match some argument. | 1380 | in the specification must match some argument. |
| 1375 | 1381 | ||
| 1376 | When a syntax error is detected, it might not be reported until much | 1382 | When a syntax error is detected, it might not be reported until much |
| 1377 | later after higher-level alternatives have been exhausted, and with the | 1383 | later, after higher-level alternatives have been exhausted, and with the |
| 1378 | point positioned further from the real error. But if backtracking is | 1384 | point positioned further from the real error. But if backtracking is |
| 1379 | disabled when an error occurs, it can be reported immediately. Note | 1385 | disabled when an error occurs, it can be reported immediately. Note |
| 1380 | that backtracking is also reenabled automatically in several situations; | 1386 | that backtracking is also reenabled automatically in several situations; |
| 1381 | it is reenabled when a new alternative is established by | 1387 | when a new alternative is established by @code{&optional}, |
| 1382 | @code{&optional}, @code{&rest}, or @code{&or}, or at the start of | 1388 | @code{&rest}, or @code{&or}, or at the start of processing a sublist, |
| 1383 | processing a sublist, group, or indirect specification. The effect of | 1389 | group, or indirect specification. The effect of enabling or disabling |
| 1384 | enabling or disabling backtracking is limited to the remainder of the | 1390 | backtracking is limited to the remainder of the level currently being |
| 1385 | level currently being processed and lower levels. | 1391 | processed and lower levels. |
| 1386 | 1392 | ||
| 1387 | Backtracking is disabled while matching any of the | 1393 | Backtracking is disabled while matching any of the |
| 1388 | form specifications (that is, @code{form}, @code{body}, @code{def-form}, and | 1394 | form specifications (that is, @code{form}, @code{body}, @code{def-form}, and |
| @@ -1413,6 +1419,7 @@ of the bindings is either a symbol or a sublist with a symbol and | |||
| 1413 | optional expression. In the specification below, notice the @code{gate} | 1419 | optional expression. In the specification below, notice the @code{gate} |
| 1414 | inside of the sublist to prevent backtracking once a sublist is found. | 1420 | inside of the sublist to prevent backtracking once a sublist is found. |
| 1415 | 1421 | ||
| 1422 | @c FIXME? The actual definition in edebug.el does not have a gate. | ||
| 1416 | @example | 1423 | @example |
| 1417 | (def-edebug-spec let | 1424 | (def-edebug-spec let |
| 1418 | ((&rest | 1425 | ((&rest |
| @@ -1420,14 +1427,14 @@ inside of the sublist to prevent backtracking once a sublist is found. | |||
| 1420 | body)) | 1427 | body)) |
| 1421 | @end example | 1428 | @end example |
| 1422 | 1429 | ||
| 1423 | Edebug uses the following specifications for @code{defun} and | 1430 | Edebug uses the following specifications for @code{defun} and the |
| 1424 | @code{defmacro} and the associated argument list and @code{interactive} | 1431 | associated argument list and @code{interactive} specifications. It is |
| 1425 | specifications. It is necessary to handle interactive forms specially | 1432 | necessary to handle interactive forms specially since an expression |
| 1426 | since an expression argument is actually evaluated outside of the | 1433 | argument is actually evaluated outside of the function body. (The |
| 1427 | function body. | 1434 | specification for @code{defmacro} is very similar to that for |
| 1435 | @code{defun}, but allows for the @code{declare} statement.) | ||
| 1428 | 1436 | ||
| 1429 | @smallexample | 1437 | @smallexample |
| 1430 | (def-edebug-spec defmacro defun) ; @r{Indirect ref to @code{defun} spec.} | ||
| 1431 | (def-edebug-spec defun | 1438 | (def-edebug-spec defun |
| 1432 | (&define name lambda-list | 1439 | (&define name lambda-list |
| 1433 | [&optional stringp] ; @r{Match the doc string, if present.} | 1440 | [&optional stringp] ; @r{Match the doc string, if present.} |
| @@ -1447,11 +1454,12 @@ function body. | |||
| 1447 | The specification for backquote below illustrates how to match | 1454 | The specification for backquote below illustrates how to match |
| 1448 | dotted lists and use @code{nil} to terminate recursion. It also | 1455 | dotted lists and use @code{nil} to terminate recursion. It also |
| 1449 | illustrates how components of a vector may be matched. (The actual | 1456 | illustrates how components of a vector may be matched. (The actual |
| 1450 | specification defined by Edebug does not support dotted lists because | 1457 | specification defined by Edebug is a little different, and does not |
| 1451 | doing so causes very deep recursion that could fail.) | 1458 | support dotted lists because doing so causes very deep recursion that |
| 1459 | could fail.) | ||
| 1452 | 1460 | ||
| 1453 | @smallexample | 1461 | @smallexample |
| 1454 | (def-edebug-spec ` (backquote-form)) ; @r{Alias just for clarity.} | 1462 | (def-edebug-spec \` (backquote-form)) ; @r{Alias just for clarity.} |
| 1455 | 1463 | ||
| 1456 | (def-edebug-spec backquote-form | 1464 | (def-edebug-spec backquote-form |
| 1457 | (&or ([&or "," ",@@"] &or ("quote" backquote-form) form) | 1465 | (&or ([&or "," ",@@"] &or ("quote" backquote-form) form) |
| @@ -1465,6 +1473,9 @@ doing so causes very deep recursion that could fail.) | |||
| 1465 | @subsection Edebug Options | 1473 | @subsection Edebug Options |
| 1466 | 1474 | ||
| 1467 | These options affect the behavior of Edebug: | 1475 | These options affect the behavior of Edebug: |
| 1476 | @c Previously defopt'd: | ||
| 1477 | @c edebug-sit-for-seconds, edebug-print-length, edebug-print-level | ||
| 1478 | @c edebug-print-circle, edebug-eval-macro-args | ||
| 1468 | 1479 | ||
| 1469 | @defopt edebug-setup-hook | 1480 | @defopt edebug-setup-hook |
| 1470 | Functions to call before Edebug is used. Each time it is set to a new | 1481 | Functions to call before Edebug is used. Each time it is set to a new |
| @@ -1513,7 +1524,7 @@ If this is non-@code{nil}, Edebug saves and restores point in all | |||
| 1513 | displayed buffers. | 1524 | displayed buffers. |
| 1514 | 1525 | ||
| 1515 | Saving and restoring point in other buffers is necessary if you are | 1526 | Saving and restoring point in other buffers is necessary if you are |
| 1516 | debugging code that changes the point of a buffer which is displayed in | 1527 | debugging code that changes the point of a buffer that is displayed in |
| 1517 | a non-selected window. If Edebug or the user then selects the window, | 1528 | a non-selected window. If Edebug or the user then selects the window, |
| 1518 | point in that buffer will move to the window's value of point. | 1529 | point in that buffer will move to the window's value of point. |
| 1519 | 1530 | ||
| @@ -1552,6 +1563,8 @@ debugged. | |||
| 1552 | @xref{Edebug Execution Modes}. | 1563 | @xref{Edebug Execution Modes}. |
| 1553 | @end defopt | 1564 | @end defopt |
| 1554 | 1565 | ||
| 1566 | @c FIXME edebug-unwrap-results | ||
| 1567 | |||
| 1555 | @defopt edebug-on-error | 1568 | @defopt edebug-on-error |
| 1556 | Edebug binds @code{debug-on-error} to this value, if | 1569 | Edebug binds @code{debug-on-error} to this value, if |
| 1557 | @code{debug-on-error} was previously @code{nil}. @xref{Trapping | 1570 | @code{debug-on-error} was previously @code{nil}. @xref{Trapping |