diff options
| author | Richard M. Stallman | 2004-11-16 17:26:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-16 17:26:18 +0000 |
| commit | 6657986f006b932cd7e88f67084d0052655fc724 (patch) | |
| tree | 5635d5f15849b62fa683991796757fedc328590e /lispref/debugging.texi | |
| parent | 231401514ae0aee4a1761b09265215b613db17d3 (diff) | |
| download | emacs-6657986f006b932cd7e88f67084d0052655fc724.tar.gz emacs-6657986f006b932cd7e88f67084d0052655fc724.zip | |
(Function Debugging, Explicit Debug): Clarified.
(Test Coverage): Don't talk about "splotches". Clarified.
Diffstat (limited to 'lispref/debugging.texi')
| -rw-r--r-- | lispref/debugging.texi | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/lispref/debugging.texi b/lispref/debugging.texi index f9096cbef2a..e893b77ed84 100644 --- a/lispref/debugging.texi +++ b/lispref/debugging.texi | |||
| @@ -221,6 +221,8 @@ up to invoke the debugger on entry, @code{debug-on-entry} does nothing. | |||
| 221 | discarded by the redefinition. In effect, redefining the function | 221 | discarded by the redefinition. In effect, redefining the function |
| 222 | cancels the break-on-entry feature for that function. | 222 | cancels the break-on-entry feature for that function. |
| 223 | 223 | ||
| 224 | Here's an example to illustrate use of this function: | ||
| 225 | |||
| 224 | @example | 226 | @example |
| 225 | @group | 227 | @group |
| 226 | (defun fact (n) | 228 | (defun fact (n) |
| @@ -276,9 +278,9 @@ not currently set up to break on entry. It always returns | |||
| 276 | You can cause the debugger to be called at a certain point in your | 278 | You can cause the debugger to be called at a certain point in your |
| 277 | program by writing the expression @code{(debug)} at that point. To do | 279 | program by writing the expression @code{(debug)} at that point. To do |
| 278 | this, visit the source file, insert the text @samp{(debug)} at the | 280 | this, visit the source file, insert the text @samp{(debug)} at the |
| 279 | proper place, and type @kbd{C-M-x}. @strong{Warning:} if you do this | 281 | proper place, and type @kbd{C-M-x} (@code{eval-defun}, a Lisp mode key |
| 280 | for temporary debugging purposes, be sure to undo this insertion before | 282 | binding). @strong{Warning:} if you do this for temporary debugging |
| 281 | you save the file! | 283 | purposes, be sure to undo this insertion before you save the file! |
| 282 | 284 | ||
| 283 | The place where you insert @samp{(debug)} must be a place where an | 285 | The place where you insert @samp{(debug)} must be a place where an |
| 284 | additional form can be evaluated and its value ignored. (If the value | 286 | additional form can be evaluated and its value ignored. (If the value |
| @@ -746,20 +748,21 @@ anything. | |||
| 746 | @findex testcover-start | 748 | @findex testcover-start |
| 747 | @findex testcover-mark-all | 749 | @findex testcover-mark-all |
| 748 | @findex testcover-next-mark | 750 | @findex testcover-next-mark |
| 749 | You can do coverage testing for a file of Lisp code by first using | 751 | You can do coverage testing for a file of Lisp code by loading the |
| 750 | the command @kbd{M-x testcover-start @key{RET} @var{file} @key{RET}} | 752 | @code{testcover} library and using the command @kbd{M-x |
| 751 | to instrument it. Then test your code by calling it one or more | 753 | testcover-start @key{RET} @var{file} @key{RET}} to instrument the |
| 752 | times. Then use the command @kbd{M-x testcover-mark-all} to display | 754 | code. Then test your code by calling it one or more times. Then use |
| 753 | ``splotches'' on the code to show where coverage is insufficient. The | 755 | the command @kbd{M-x testcover-mark-all} to display colored highlights |
| 754 | command @kbd{M-x testcover-next-mark} will move point forward to the | 756 | on the code to show where coverage is insufficient. The command |
| 755 | next spot that has a splotch. | 757 | @kbd{M-x testcover-next-mark} will move point forward to the next |
| 756 | 758 | highlighted spot. | |
| 757 | Normally, a red splotch indicates the form was never completely | 759 | |
| 758 | evaluated; a brown splotch means it always evaluated to the same value | 760 | Normally, a red highlight indicates the form was never completely |
| 759 | (meaning there has been little testing of what is done with the | 761 | evaluated; a brown highlight means it always evaluated to the same |
| 760 | result). However, the red splotch is skipped for forms that can't | 762 | value (meaning there has been little testing of what is done with the |
| 763 | result). However, the red highlight is skipped for forms that can't | ||
| 761 | possibly complete their evaluation, such as @code{error}. The brown | 764 | possibly complete their evaluation, such as @code{error}. The brown |
| 762 | splotch is skipped for forms that are expected to always evaluate to | 765 | highlight is skipped for forms that are expected to always evaluate to |
| 763 | the same value, such as @code{(setq x 14)}. | 766 | the same value, such as @code{(setq x 14)}. |
| 764 | 767 | ||
| 765 | For difficult cases, you can add do-nothing macros to your code to | 768 | For difficult cases, you can add do-nothing macros to your code to |