221 |
discarded by the redefinition. In effect, redefining the function |
discarded by the redefinition. In effect, redefining the function |
222 |
cancels the break-on-entry feature for that function. |
cancels the break-on-entry feature for that function. |
223 |
|
|
224 |
|
Here's an example to illustrate use of this function: |
225 |
|
|
226 |
@example |
@example |
227 |
@group |
@group |
228 |
(defun fact (n) |
(defun fact (n) |
278 |
You can cause the debugger to be called at a certain point in your |
You can cause the debugger to be called at a certain point in your |
279 |
program by writing the expression @code{(debug)} at that point. To do |
program by writing the expression @code{(debug)} at that point. To do |
280 |
this, visit the source file, insert the text @samp{(debug)} at the |
this, visit the source file, insert the text @samp{(debug)} at the |
281 |
proper place, and type @kbd{C-M-x}. @strong{Warning:} if you do this |
proper place, and type @kbd{C-M-x} (@code{eval-defun}, a Lisp mode key |
282 |
for temporary debugging purposes, be sure to undo this insertion before |
binding). @strong{Warning:} if you do this for temporary debugging |
283 |
you save the file! |
purposes, be sure to undo this insertion before you save the file! |
284 |
|
|
285 |
The place where you insert @samp{(debug)} must be a place where an |
The place where you insert @samp{(debug)} must be a place where an |
286 |
additional form can be evaluated and its value ignored. (If the value |
additional form can be evaluated and its value ignored. (If the value |
748 |
@findex testcover-start |
@findex testcover-start |
749 |
@findex testcover-mark-all |
@findex testcover-mark-all |
750 |
@findex testcover-next-mark |
@findex testcover-next-mark |
751 |
You can do coverage testing for a file of Lisp code by first using |
You can do coverage testing for a file of Lisp code by loading the |
752 |
the command @kbd{M-x testcover-start @key{RET} @var{file} @key{RET}} |
@code{testcover} library and using the command @kbd{M-x |
753 |
to instrument it. Then test your code by calling it one or more |
testcover-start @key{RET} @var{file} @key{RET}} to instrument the |
754 |
times. Then use the command @kbd{M-x testcover-mark-all} to display |
code. Then test your code by calling it one or more times. Then use |
755 |
``splotches'' on the code to show where coverage is insufficient. The |
the command @kbd{M-x testcover-mark-all} to display colored highlights |
756 |
command @kbd{M-x testcover-next-mark} will move point forward to the |
on the code to show where coverage is insufficient. The command |
757 |
next spot that has a splotch. |
@kbd{M-x testcover-next-mark} will move point forward to the next |
758 |
|
highlighted spot. |
759 |
Normally, a red splotch indicates the form was never completely |
|
760 |
evaluated; a brown splotch means it always evaluated to the same value |
Normally, a red highlight indicates the form was never completely |
761 |
(meaning there has been little testing of what is done with the |
evaluated; a brown highlight means it always evaluated to the same |
762 |
result). However, the red splotch is skipped for forms that can't |
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 |
764 |
possibly complete their evaluation, such as @code{error}. The brown |
possibly complete their evaluation, such as @code{error}. The brown |
765 |
splotch is skipped for forms that are expected to always evaluate to |
highlight is skipped for forms that are expected to always evaluate to |
766 |
the same value, such as @code{(setq x 14)}. |
the same value, such as @code{(setq x 14)}. |
767 |
|
|
768 |
For difficult cases, you can add do-nothing macros to your code to |
For difficult cases, you can add do-nothing macros to your code to |