diff options
| author | Karoly Lorentey | 2005-03-06 13:31:20 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-03-06 13:31:20 +0000 |
| commit | a0d878a9ccbfb7c68dd7cfbe05c2b71b9bd5c830 (patch) | |
| tree | 79ba80d6f6c4b787c60b36ebcd87c1b26f0906e1 /lispref | |
| parent | ab455350da7728b0f8e1daf92c084092d8a04c29 (diff) | |
| parent | be6e87e51aaa3a114bc4ff2ceccbc7c9aa2b30d0 (diff) | |
| download | emacs-a0d878a9ccbfb7c68dd7cfbe05c2b71b9bd5c830.tar.gz emacs-a0d878a9ccbfb7c68dd7cfbe05c2b71b9bd5c830.zip | |
Merged from miles@gnu.org--gnu-2005 (patch 34-36, 142-158)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-142
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-143
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-144
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-145
(make-text-button): Default button type if not specified
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-146
quick-install-emacs: Use mkdir --verbose only when requested
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-147
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-148
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-149
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-150
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-151
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-152
Add info/dir to arch branch
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-153
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-154
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-155
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-156
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-157
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-158
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-34
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-35
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-36
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-303
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 29 | ||||
| -rw-r--r-- | lispref/debugging.texi | 120 | ||||
| -rw-r--r-- | lispref/edebug.texi | 4 |
3 files changed, 99 insertions, 54 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index de0294cffa9..105fbec9a7d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2005-03-05 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * debugging.texi (Error Debugging): Remove stack-trace-on-error. | ||
| 4 | |||
| 5 | 2005-03-04 Lute Kamstra <lute@gnu.org> | ||
| 6 | |||
| 7 | * debugging.texi (Error Debugging): Document stack-trace-on-error. | ||
| 8 | |||
| 9 | 2005-03-03 Lute Kamstra <lute@gnu.org> | ||
| 10 | |||
| 11 | * edebug.texi (Instrumenting Macro Calls): Fix typo. | ||
| 12 | |||
| 13 | 2005-03-01 Lute Kamstra <lute@gnu.org> | ||
| 14 | |||
| 15 | * debugging.texi (Debugger Commands): Update `j'. | ||
| 16 | |||
| 17 | 2005-02-28 Lute Kamstra <lute@gnu.org> | ||
| 18 | |||
| 19 | * debugging.texi (Debugging): Fix typo. | ||
| 20 | (Error Debugging): Document eval-expression-debug-on-error. | ||
| 21 | (Function Debugging): Update example. | ||
| 22 | (Using Debugger): Mention starred stack frames. | ||
| 23 | (Debugger Commands): Document `j' and `l'. | ||
| 24 | (Invoking the Debugger): `d' and `j' exit recursive edit too. | ||
| 25 | Update the messages that the debugger displays. | ||
| 26 | (Internals of Debugger): Add cross reference. Update example. | ||
| 27 | (Excess Open): Minor improvement. | ||
| 28 | (Excess Close): Minor improvement. | ||
| 29 | |||
| 1 | 2005-02-26 Richard M. Stallman <rms@gnu.org> | 30 | 2005-02-26 Richard M. Stallman <rms@gnu.org> |
| 2 | 31 | ||
| 3 | * tips.texi (Coding Conventions): Clarify. | 32 | * tips.texi (Coding Conventions): Clarify. |
diff --git a/lispref/debugging.texi b/lispref/debugging.texi index e893b77ed84..07dfe18f283 100644 --- a/lispref/debugging.texi +++ b/lispref/debugging.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999 | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2005 |
| 4 | @c Free Software Foundation, Inc. | 4 | @c Free Software Foundation, Inc. |
| 5 | @c See the file elisp.texi for copying conditions. | 5 | @c See the file elisp.texi for copying conditions. |
| 6 | @setfilename ../info/debugging | 6 | @setfilename ../info/debugging |
| @@ -14,7 +14,7 @@ depending on what you are doing with the program when the problem appears. | |||
| 14 | @item | 14 | @item |
| 15 | If the problem occurs when you run the program, you can use a Lisp | 15 | If the problem occurs when you run the program, you can use a Lisp |
| 16 | debugger to investigate what is happening during execution. In addition | 16 | debugger to investigate what is happening during execution. In addition |
| 17 | to the ordinary debugger, Emacs comes with a source level debugger, | 17 | to the ordinary debugger, Emacs comes with a source-level debugger, |
| 18 | Edebug. This chapter describes both of them. | 18 | Edebug. This chapter describes both of them. |
| 19 | 19 | ||
| 20 | @item | 20 | @item |
| @@ -117,6 +117,15 @@ the error. The easiest way is usually to set | |||
| 117 | @code{debug-ignored-errors} to @code{nil}. | 117 | @code{debug-ignored-errors} to @code{nil}. |
| 118 | @end defopt | 118 | @end defopt |
| 119 | 119 | ||
| 120 | @defopt eval-expression-debug-on-error | ||
| 121 | If you set this variable to a non-@code{nil} value, then | ||
| 122 | @code{debug-on-error} will be set to @code{t} when evaluating with the | ||
| 123 | command @code{eval-expression}. If | ||
| 124 | @code{eval-expression-debug-on-error} is @code{nil}, then the value of | ||
| 125 | @code{debug-on-error} is not changed. @xref{Lisp Eval,, Evaluating | ||
| 126 | Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. | ||
| 127 | @end defopt | ||
| 128 | |||
| 120 | @defopt debug-on-signal | 129 | @defopt debug-on-signal |
| 121 | Normally, errors that are caught by @code{condition-case} never run the | 130 | Normally, errors that are caught by @code{condition-case} never run the |
| 122 | debugger, even if @code{debug-on-error} is non-@code{nil}. In other | 131 | debugger, even if @code{debug-on-error} is non-@code{nil}. In other |
| @@ -240,14 +249,12 @@ Here's an example to illustrate use of this function: | |||
| 240 | 249 | ||
| 241 | @group | 250 | @group |
| 242 | ------ Buffer: *Backtrace* ------ | 251 | ------ Buffer: *Backtrace* ------ |
| 243 | Entering: | 252 | Debugger entered--entering a function: |
| 244 | * fact(3) | 253 | * fact(3) |
| 245 | eval-region(4870 4878 t) | 254 | eval((fact 3)) |
| 246 | byte-code("...") | 255 | eval-last-sexp-1(nil) |
| 247 | eval-last-sexp(nil) | 256 | eval-last-sexp(nil) |
| 248 | (let ...) | 257 | call-interactively(eval-last-sexp) |
| 249 | eval-insert-last-sexp(nil) | ||
| 250 | * call-interactively(eval-insert-last-sexp) | ||
| 251 | ------ Buffer: *Backtrace* ------ | 258 | ------ Buffer: *Backtrace* ------ |
| 252 | @end group | 259 | @end group |
| 253 | 260 | ||
| @@ -317,7 +324,9 @@ moving point to the line describing that frame. (A stack frame is the | |||
| 317 | place where the Lisp interpreter records information about a particular | 324 | place where the Lisp interpreter records information about a particular |
| 318 | invocation of a function.) The frame whose line point is on is | 325 | invocation of a function.) The frame whose line point is on is |
| 319 | considered the @dfn{current frame}. Some of the debugger commands | 326 | considered the @dfn{current frame}. Some of the debugger commands |
| 320 | operate on the current frame. | 327 | operate on the current frame. If a line starts with a star, that means |
| 328 | that exiting that frame will call the debugger again. This is useful | ||
| 329 | for examining the return value of a function. | ||
| 321 | 330 | ||
| 322 | If a function name is underlined, that means the debugger knows | 331 | If a function name is underlined, that means the debugger knows |
| 323 | where its source code is located. You can click @kbd{Mouse-2} on that | 332 | where its source code is located. You can click @kbd{Mouse-2} on that |
| @@ -328,8 +337,6 @@ assumptions about how many stack frames are used for the debugger | |||
| 328 | itself. These assumptions are false if the debugger is running | 337 | itself. These assumptions are false if the debugger is running |
| 329 | interpreted. | 338 | interpreted. |
| 330 | 339 | ||
| 331 | @need 3000 | ||
| 332 | |||
| 333 | @node Debugger Commands | 340 | @node Debugger Commands |
| 334 | @subsection Debugger Commands | 341 | @subsection Debugger Commands |
| 335 | @cindex debugger command list | 342 | @cindex debugger command list |
| @@ -378,6 +385,11 @@ Don't enter the debugger when the current frame is exited. This | |||
| 378 | cancels a @kbd{b} command on that frame. The visible effect is to | 385 | cancels a @kbd{b} command on that frame. The visible effect is to |
| 379 | remove the star from the line in the backtrace buffer. | 386 | remove the star from the line in the backtrace buffer. |
| 380 | 387 | ||
| 388 | @item j | ||
| 389 | Flag the current frame like @kbd{b}. Then continue execution like | ||
| 390 | @kbd{c}, but temporarily disable break-on-entry for all functions that | ||
| 391 | are set up to do so by @code{debug-on-entry}. | ||
| 392 | |||
| 381 | @item e | 393 | @item e |
| 382 | Read a Lisp expression in the minibuffer, evaluate it, and print the | 394 | Read a Lisp expression in the minibuffer, evaluate it, and print the |
| 383 | value in the echo area. The debugger alters certain important | 395 | value in the echo area. The debugger alters certain important |
| @@ -410,6 +422,13 @@ used as the value of that frame. It is also useful if you call | |||
| 410 | effect as @kbd{c}, and the specified return value does not matter. | 422 | effect as @kbd{c}, and the specified return value does not matter. |
| 411 | 423 | ||
| 412 | You can't use @kbd{r} when the debugger was entered due to an error. | 424 | You can't use @kbd{r} when the debugger was entered due to an error. |
| 425 | |||
| 426 | @item l | ||
| 427 | Display a list of functions that will invoke the debugger when called. | ||
| 428 | This is a list of functions that are set to break on entry by means of | ||
| 429 | @code{debug-on-entry}. @strong{Warning:} if you redefine such a | ||
| 430 | function and thus cancel the effect of @code{debug-on-entry}, it may | ||
| 431 | erroneously show up in this list. | ||
| 413 | @end table | 432 | @end table |
| 414 | 433 | ||
| 415 | @node Invoking the Debugger | 434 | @node Invoking the Debugger |
| @@ -425,10 +444,10 @@ recursive entry to the debugger, etc.), and fills it with information | |||
| 425 | about the stack of Lisp function calls. It then enters a recursive | 444 | about the stack of Lisp function calls. It then enters a recursive |
| 426 | edit, showing the backtrace buffer in Debugger mode. | 445 | edit, showing the backtrace buffer in Debugger mode. |
| 427 | 446 | ||
| 428 | The Debugger mode @kbd{c} and @kbd{r} commands exit the recursive edit; | 447 | The Debugger mode @kbd{c}, @kbd{d}, @kbd{j}, and @kbd{r} commands exit |
| 429 | then @code{debug} switches back to the previous buffer and returns to | 448 | the recursive edit; then @code{debug} switches back to the previous |
| 430 | whatever called @code{debug}. This is the only way the function | 449 | buffer and returns to whatever called @code{debug}. This is the only |
| 431 | @code{debug} can return to its caller. | 450 | way the function @code{debug} can return to its caller. |
| 432 | 451 | ||
| 433 | The use of the @var{debugger-args} is that @code{debug} displays the | 452 | The use of the @var{debugger-args} is that @code{debug} displays the |
| 434 | rest of its arguments at the top of the @samp{*Backtrace*} buffer, so | 453 | rest of its arguments at the top of the @samp{*Backtrace*} buffer, so |
| @@ -443,41 +462,41 @@ is a table of these special values: | |||
| 443 | @table @code | 462 | @table @code |
| 444 | @item lambda | 463 | @item lambda |
| 445 | @cindex @code{lambda} in debug | 464 | @cindex @code{lambda} in debug |
| 446 | A first argument of @code{lambda} means @code{debug} was called because | 465 | A first argument of @code{lambda} means @code{debug} was called |
| 447 | of entry to a function when @code{debug-on-next-call} was | 466 | because of entry to a function when @code{debug-on-next-call} was |
| 448 | non-@code{nil}. The debugger displays @samp{Entering:} as a line of | 467 | non-@code{nil}. The debugger displays @samp{Debugger |
| 449 | text at the top of the buffer. | 468 | entered--entering a function:} as a line of text at the top of the |
| 469 | buffer. | ||
| 450 | 470 | ||
| 451 | @item debug | 471 | @item debug |
| 452 | @code{debug} as first argument indicates a call to @code{debug} because | 472 | @code{debug} as first argument indicates a call to @code{debug} |
| 453 | of entry to a function that was set to debug on entry. The debugger | 473 | because of entry to a function that was set to debug on entry. The |
| 454 | displays @samp{Entering:}, just as in the @code{lambda} case. It also | 474 | debugger displays @samp{Debugger entered--entering a function:}, just |
| 455 | marks the stack frame for that function so that it will invoke the | 475 | as in the @code{lambda} case. It also marks the stack frame for that |
| 456 | debugger when exited. | 476 | function so that it will invoke the debugger when exited. |
| 457 | 477 | ||
| 458 | @item t | 478 | @item t |
| 459 | When the first argument is @code{t}, this indicates a call to | 479 | When the first argument is @code{t}, this indicates a call to |
| 460 | @code{debug} due to evaluation of a list form when | 480 | @code{debug} due to evaluation of a list form when |
| 461 | @code{debug-on-next-call} is non-@code{nil}. The debugger displays the | 481 | @code{debug-on-next-call} is non-@code{nil}. The debugger displays |
| 462 | following as the top line in the buffer: | 482 | @samp{Debugger entered--beginning evaluation of function call form:} |
| 463 | 483 | as the top line in the buffer. | |
| 464 | @smallexample | ||
| 465 | Beginning evaluation of function call form: | ||
| 466 | @end smallexample | ||
| 467 | 484 | ||
| 468 | @item exit | 485 | @item exit |
| 469 | When the first argument is @code{exit}, it indicates the exit of a stack | 486 | When the first argument is @code{exit}, it indicates the exit of a |
| 470 | frame previously marked to invoke the debugger on exit. The second | 487 | stack frame previously marked to invoke the debugger on exit. The |
| 471 | argument given to @code{debug} in this case is the value being returned | 488 | second argument given to @code{debug} in this case is the value being |
| 472 | from the frame. The debugger displays @samp{Return value:} in the top | 489 | returned from the frame. The debugger displays @samp{Debugger |
| 473 | line of the buffer, followed by the value being returned. | 490 | entered--returning value:} in the top line of the buffer, followed by |
| 491 | the value being returned. | ||
| 474 | 492 | ||
| 475 | @item error | 493 | @item error |
| 476 | @cindex @code{error} in debug | 494 | @cindex @code{error} in debug |
| 477 | When the first argument is @code{error}, the debugger indicates that | 495 | When the first argument is @code{error}, the debugger indicates that |
| 478 | it is being entered because an error or @code{quit} was signaled and not | 496 | it is being entered because an error or @code{quit} was signaled and |
| 479 | handled, by displaying @samp{Signaling:} followed by the error signaled | 497 | not handled, by displaying @samp{Debugger entered--Lisp error:} |
| 480 | and any arguments to @code{signal}. For example, | 498 | followed by the error signaled and any arguments to @code{signal}. |
| 499 | For example, | ||
| 481 | 500 | ||
| 482 | @example | 501 | @example |
| 483 | @group | 502 | @group |
| @@ -487,7 +506,7 @@ and any arguments to @code{signal}. For example, | |||
| 487 | 506 | ||
| 488 | @group | 507 | @group |
| 489 | ------ Buffer: *Backtrace* ------ | 508 | ------ Buffer: *Backtrace* ------ |
| 490 | Signaling: (arith-error) | 509 | Debugger entered--Lisp error: (arith-error) |
| 491 | /(1 0) | 510 | /(1 0) |
| 492 | ... | 511 | ... |
| 493 | ------ Buffer: *Backtrace* ------ | 512 | ------ Buffer: *Backtrace* ------ |
| @@ -522,7 +541,7 @@ some kind of debugger. The default value of the variable is | |||
| 522 | 541 | ||
| 523 | The first argument that Lisp hands to the function indicates why it | 542 | The first argument that Lisp hands to the function indicates why it |
| 524 | was called. The convention for arguments is detailed in the description | 543 | was called. The convention for arguments is detailed in the description |
| 525 | of @code{debug}. | 544 | of @code{debug} (@pxref{Invoking the Debugger}). |
| 526 | @end defvar | 545 | @end defvar |
| 527 | 546 | ||
| 528 | @deffn Command backtrace | 547 | @deffn Command backtrace |
| @@ -567,17 +586,14 @@ forms are elided. | |||
| 567 | (save-excursion ...) | 586 | (save-excursion ...) |
| 568 | (let ...) | 587 | (let ...) |
| 569 | (with-output-to-temp-buffer ...) | 588 | (with-output-to-temp-buffer ...) |
| 570 | eval-region(1973 2142 #<buffer *scratch*>) | 589 | eval((with-output-to-temp-buffer ...)) |
| 571 | byte-code("... for eval-print-last-sexp ...") | 590 | eval-last-sexp-1(nil) |
| 572 | @group | 591 | @group |
| 573 | eval-print-last-sexp(nil) | 592 | eval-last-sexp(nil) |
| 574 | * call-interactively(eval-print-last-sexp) | 593 | call-interactively(eval-last-sexp) |
| 575 | ----------- Buffer: backtrace-output ------------ | 594 | ----------- Buffer: backtrace-output ------------ |
| 576 | @end group | 595 | @end group |
| 577 | @end smallexample | 596 | @end smallexample |
| 578 | |||
| 579 | The character @samp{*} indicates a frame whose debug-on-exit flag is | ||
| 580 | set. | ||
| 581 | @end deffn | 597 | @end deffn |
| 582 | 598 | ||
| 583 | @ignore @c Not worth mentioning | 599 | @ignore @c Not worth mentioning |
| @@ -687,8 +703,8 @@ find the mismatch.) | |||
| 687 | 703 | ||
| 688 | The first step is to find the defun that is unbalanced. If there is | 704 | The first step is to find the defun that is unbalanced. If there is |
| 689 | an excess open parenthesis, the way to do this is to go to the end of | 705 | an excess open parenthesis, the way to do this is to go to the end of |
| 690 | the file and type @kbd{C-u C-M-u}. This will move you to the beginning | 706 | the file and type @kbd{C-u C-M-u}. This will move you to the |
| 691 | of the defun that is unbalanced. | 707 | beginning of the first defun that is unbalanced. |
| 692 | 708 | ||
| 693 | The next step is to determine precisely what is wrong. There is no | 709 | The next step is to determine precisely what is wrong. There is no |
| 694 | way to be sure of this except by studying the program, but often the | 710 | way to be sure of this except by studying the program, but often the |
| @@ -719,9 +735,9 @@ anything. | |||
| 719 | @node Excess Close | 735 | @node Excess Close |
| 720 | @subsection Excess Close Parentheses | 736 | @subsection Excess Close Parentheses |
| 721 | 737 | ||
| 722 | To deal with an excess close parenthesis, first go to the beginning of | 738 | To deal with an excess close parenthesis, first go to the beginning |
| 723 | the file, then type @kbd{C-u -1 C-M-u} to find the end of the unbalanced | 739 | of the file, then type @kbd{C-u -1 C-M-u} to find the end of the first |
| 724 | defun. | 740 | unbalanced defun. |
| 725 | 741 | ||
| 726 | Then find the actual matching close parenthesis by typing @kbd{C-M-f} | 742 | Then find the actual matching close parenthesis by typing @kbd{C-M-f} |
| 727 | at the beginning of that defun. This will leave you somewhere short of | 743 | at the beginning of that defun. This will leave you somewhere short of |
diff --git a/lispref/edebug.texi b/lispref/edebug.texi index bcd7eba5b6f..835ddf91e94 100644 --- a/lispref/edebug.texi +++ b/lispref/edebug.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @comment -*-texinfo-*- | 1 | @comment -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1992, 1993, 1994, 1998, 1999 Free Software Foundation, Inc. | 3 | @c Copyright (C) 1992, 1993, 1994, 1998, 1999, 2005 Free Software Foundation, Inc. |
| 4 | @c See the file elisp.texi for copying conditions. | 4 | @c See the file elisp.texi for copying conditions. |
| 5 | 5 | ||
| 6 | @c This file can also be used by an independent Edebug User | 6 | @c This file can also be used by an independent Edebug User |
| @@ -1082,7 +1082,7 @@ the @code{for} example macro (@pxref{Argument Evaluation}). | |||
| 1082 | (defmacro for (var from init to final do &rest body) | 1082 | (defmacro for (var from init to final do &rest body) |
| 1083 | "Execute a simple \"for\" loop. | 1083 | "Execute a simple \"for\" loop. |
| 1084 | For example, (for i from 1 to 10 do (print i))." | 1084 | For example, (for i from 1 to 10 do (print i))." |
| 1085 | (declare (edebug symbolp "from" form "to" form "do" &rest form)) | 1085 | (declare (debug symbolp "from" form "to" form "do" &rest form)) |
| 1086 | ...) | 1086 | ...) |
| 1087 | @end example | 1087 | @end example |
| 1088 | 1088 | ||