diff options
| author | Richard M. Stallman | 1999-09-17 06:59:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-17 06:59:04 +0000 |
| commit | 8241495da57ca0efed1b2e86ff693b5614e0aebd (patch) | |
| tree | ee1fca7ca3eafe24dbbf651622196bc849203e69 /lispref/debugging.texi | |
| parent | 106217c6600b3049f1c62afaf198b9382206acba (diff) | |
| download | emacs-8241495da57ca0efed1b2e86ff693b5614e0aebd.tar.gz emacs-8241495da57ca0efed1b2e86ff693b5614e0aebd.zip | |
*** empty log message ***
Diffstat (limited to 'lispref/debugging.texi')
| -rw-r--r-- | lispref/debugging.texi | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/lispref/debugging.texi b/lispref/debugging.texi index 4bc3d07d69b..8946cf0baab 100644 --- a/lispref/debugging.texi +++ b/lispref/debugging.texi | |||
| @@ -510,9 +510,9 @@ debugger. | |||
| 510 | 510 | ||
| 511 | @defvar debugger | 511 | @defvar debugger |
| 512 | The value of this variable is the function to call to invoke the | 512 | The value of this variable is the function to call to invoke the |
| 513 | debugger. Its value must be a function of any number of arguments (or, | 513 | debugger. Its value must be a function of any number of arguments, or, |
| 514 | more typically, the name of a function). Presumably this function will | 514 | more typically, the name of a function. This function should invoke |
| 515 | enter some kind of debugger. The default value of the variable is | 515 | some kind of debugger. The default value of the variable is |
| 516 | @code{debug}. | 516 | @code{debug}. |
| 517 | 517 | ||
| 518 | The first argument that Lisp hands to the function indicates why it | 518 | The first argument that Lisp hands to the function indicates why it |
| @@ -531,11 +531,13 @@ value is always @code{nil}. | |||
| 531 | 531 | ||
| 532 | In the following example, a Lisp expression calls @code{backtrace} | 532 | In the following example, a Lisp expression calls @code{backtrace} |
| 533 | explicitly. This prints the backtrace to the stream | 533 | explicitly. This prints the backtrace to the stream |
| 534 | @code{standard-output}: in this case, to the buffer | 534 | @code{standard-output}, which, in this case, is the buffer |
| 535 | @samp{backtrace-output}. Each line of the backtrace represents one | 535 | @samp{backtrace-output}. |
| 536 | function call. The line shows the values of the function's arguments if | 536 | |
| 537 | they are all known. If they are still being computed, the line says so. | 537 | Each line of the backtrace represents one function call. The line shows |
| 538 | The arguments of special forms are elided. | 538 | the values of the function's arguments if they are all known; if they |
| 539 | are still being computed, the line says so. The arguments of special | ||
| 540 | forms are elided. | ||
| 539 | 541 | ||
| 540 | @smallexample | 542 | @smallexample |
| 541 | @group | 543 | @group |
| @@ -620,9 +622,9 @@ bound to @code{nil}. The debugger can set this variable to leave | |||
| 620 | information for future debugger invocations during the same command | 622 | information for future debugger invocations during the same command |
| 621 | invocation. | 623 | invocation. |
| 622 | 624 | ||
| 623 | The advantage, for the debugger, of using this variable rather than an | 625 | The advantage of using this variable rather than an ordinary global |
| 624 | ordinary global variable is that the data will never carry over to a | 626 | variable is that the data will never carry over to a subsequent command |
| 625 | subsequent command invocation. | 627 | invocation. |
| 626 | @end defvar | 628 | @end defvar |
| 627 | 629 | ||
| 628 | @defun backtrace-frame frame-number | 630 | @defun backtrace-frame frame-number |
| @@ -630,11 +632,11 @@ The function @code{backtrace-frame} is intended for use in Lisp | |||
| 630 | debuggers. It returns information about what computation is happening | 632 | debuggers. It returns information about what computation is happening |
| 631 | in the stack frame @var{frame-number} levels down. | 633 | in the stack frame @var{frame-number} levels down. |
| 632 | 634 | ||
| 633 | If that frame has not evaluated the arguments yet (or is a special | 635 | If that frame has not evaluated the arguments yet, or is a special |
| 634 | form), the value is @code{(nil @var{function} @var{arg-forms}@dots{})}. | 636 | form, the value is @code{(nil @var{function} @var{arg-forms}@dots{})}. |
| 635 | 637 | ||
| 636 | If that frame has evaluated its arguments and called its function | 638 | If that frame has evaluated its arguments and called its function |
| 637 | already, the value is @code{(t @var{function} | 639 | already, the return value is @code{(t @var{function} |
| 638 | @var{arg-values}@dots{})}. | 640 | @var{arg-values}@dots{})}. |
| 639 | 641 | ||
| 640 | In the return value, @var{function} is whatever was supplied as the | 642 | In the return value, @var{function} is whatever was supplied as the |
| @@ -679,12 +681,9 @@ find the mismatch.) | |||
| 679 | @subsection Excess Open Parentheses | 681 | @subsection Excess Open Parentheses |
| 680 | 682 | ||
| 681 | The first step is to find the defun that is unbalanced. If there is | 683 | The first step is to find the defun that is unbalanced. If there is |
| 682 | an excess open parenthesis, the way to do this is to insert a | 684 | an excess open parenthesis, the way to do this is to go to the end of |
| 683 | close parenthesis at the end of the file and type @kbd{C-M-b} | 685 | the file and type @kbd{C-u C-M-u}. This will move you to the beginning |
| 684 | (@code{backward-sexp}). This will move you to the beginning of the | 686 | of the defun that is unbalanced. |
| 685 | defun that is unbalanced. (Then type @kbd{C-@key{SPC} C-_ C-u | ||
| 686 | C-@key{SPC}} to set the mark there, undo the insertion of the | ||
| 687 | close parenthesis, and finally return to the mark.) | ||
| 688 | 687 | ||
| 689 | The next step is to determine precisely what is wrong. There is no | 688 | The next step is to determine precisely what is wrong. There is no |
| 690 | way to be sure of this except by studying the program, but often the | 689 | way to be sure of this except by studying the program, but often the |
| @@ -715,11 +714,9 @@ anything. | |||
| 715 | @node Excess Close | 714 | @node Excess Close |
| 716 | @subsection Excess Close Parentheses | 715 | @subsection Excess Close Parentheses |
| 717 | 716 | ||
| 718 | To deal with an excess close parenthesis, first insert an open | 717 | To deal with an excess close parenthesis, first go to the beginning of |
| 719 | parenthesis at the beginning of the file, back up over it, and type | 718 | the file, then type @kbd{C-u -1 C-M-u} to find the end of the unbalanced |
| 720 | @kbd{C-M-f} to find the end of the unbalanced defun. (Then type | 719 | defun. |
| 721 | @kbd{C-@key{SPC} C-_ C-u C-@key{SPC}} to set the mark there, undo the | ||
| 722 | insertion of the open parenthesis, and finally return to the mark.) | ||
| 723 | 720 | ||
| 724 | Then find the actual matching close parenthesis by typing @kbd{C-M-f} | 721 | Then find the actual matching close parenthesis by typing @kbd{C-M-f} |
| 725 | at the beginning of that defun. This will leave you somewhere short of | 722 | at the beginning of that defun. This will leave you somewhere short of |