diff options
| author | Lars Ingebrigtsen | 2019-10-20 13:40:03 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-20 13:40:03 +0200 |
| commit | 23b30327020c3f59691fbb20f061691c7bb15bdd (patch) | |
| tree | a101fcbc8d57a6ed85205c97a7fc968bc2b1d6e1 | |
| parent | a4e7c15484a9330fb9e1a1b425fcf1b37bad04e1 (diff) | |
| download | emacs-23b30327020c3f59691fbb20f061691c7bb15bdd.tar.gz emacs-23b30327020c3f59691fbb20f061691c7bb15bdd.zip | |
New command to clear all breakpoints in a function
* doc/lispref/edebug.texi (Breakpoints): Mention it.
* lisp/emacs-lisp/edebug.el (edebug-unset-breakpoints): New
command and keystroke.
| -rw-r--r-- | doc/lispref/edebug.texi | 4 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/edebug.el | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index efbba40916e..e081833e242 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi | |||
| @@ -503,6 +503,10 @@ program. | |||
| 503 | Unset the breakpoint (if any) at the stop point at or after | 503 | Unset the breakpoint (if any) at the stop point at or after |
| 504 | point (@code{edebug-unset-breakpoint}). | 504 | point (@code{edebug-unset-breakpoint}). |
| 505 | 505 | ||
| 506 | @item U | ||
| 507 | Unset any breakpoints in the current form | ||
| 508 | (@code{edebug-unset-breakpoints}). | ||
| 509 | |||
| 506 | @item x @var{condition} @key{RET} | 510 | @item x @var{condition} @key{RET} |
| 507 | Set a conditional breakpoint which stops the program only if | 511 | Set a conditional breakpoint which stops the program only if |
| 508 | evaluating @var{condition} produces a non-@code{nil} value | 512 | evaluating @var{condition} produces a non-@code{nil} value |
| @@ -1462,6 +1462,11 @@ the Elisp manual for documentation of the new mode and its commands. | |||
| 1462 | 1462 | ||
| 1463 | ** Edebug | 1463 | ** Edebug |
| 1464 | 1464 | ||
| 1465 | +++ | ||
| 1466 | *** New command 'edebug-unset-breakpoints' | ||
| 1467 | To clear all breakpoints in the current form, the 'U' command in | ||
| 1468 | 'edebug-mode', or 'M-x edebug-unset-breakpoints' can be used. | ||
| 1469 | |||
| 1465 | --- | 1470 | --- |
| 1466 | *** Re-instrumenting a function with Edebug will now try to preserve | 1471 | *** Re-instrumenting a function with Edebug will now try to preserve |
| 1467 | previously-set breakpoints. If the code has changed substantially, | 1472 | previously-set breakpoints. If the code has changed substantially, |
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 68b2126345f..f59123094ac 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el | |||
| @@ -3249,6 +3249,17 @@ With prefix argument, make it a temporary breakpoint." | |||
| 3249 | (interactive) | 3249 | (interactive) |
| 3250 | (edebug-modify-breakpoint nil)) | 3250 | (edebug-modify-breakpoint nil)) |
| 3251 | 3251 | ||
| 3252 | (defun edebug-unset-breakpoints () | ||
| 3253 | "Unset all the breakpoints in the current form." | ||
| 3254 | (interactive) | ||
| 3255 | (let* ((name (edebug-form-data-symbol)) | ||
| 3256 | (breakpoints (nth 1 (get name 'edebug)))) | ||
| 3257 | (unless breakpoints | ||
| 3258 | (user-error "There are no breakpoints in %s" name)) | ||
| 3259 | (save-excursion | ||
| 3260 | (dolist (breakpoint breakpoints) | ||
| 3261 | (goto-char (nth 3 breakpoint)) | ||
| 3262 | (edebug-modify-breakpoint nil))))) | ||
| 3252 | 3263 | ||
| 3253 | (defun edebug-set-global-break-condition (expression) | 3264 | (defun edebug-set-global-break-condition (expression) |
| 3254 | "Set `edebug-global-break-condition' to EXPRESSION." | 3265 | "Set `edebug-global-break-condition' to EXPRESSION." |
| @@ -3756,6 +3767,7 @@ be installed in `emacs-lisp-mode-map'.") | |||
| 3756 | ;; breakpoints | 3767 | ;; breakpoints |
| 3757 | (define-key map "b" 'edebug-set-breakpoint) | 3768 | (define-key map "b" 'edebug-set-breakpoint) |
| 3758 | (define-key map "u" 'edebug-unset-breakpoint) | 3769 | (define-key map "u" 'edebug-unset-breakpoint) |
| 3770 | (define-key map "U" 'edebug-unset-breakpoints) | ||
| 3759 | (define-key map "B" 'edebug-next-breakpoint) | 3771 | (define-key map "B" 'edebug-next-breakpoint) |
| 3760 | (define-key map "x" 'edebug-set-conditional-breakpoint) | 3772 | (define-key map "x" 'edebug-set-conditional-breakpoint) |
| 3761 | (define-key map "X" 'edebug-set-global-break-condition) | 3773 | (define-key map "X" 'edebug-set-global-break-condition) |