aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-20 13:40:03 +0200
committerLars Ingebrigtsen2019-10-20 13:40:03 +0200
commit23b30327020c3f59691fbb20f061691c7bb15bdd (patch)
treea101fcbc8d57a6ed85205c97a7fc968bc2b1d6e1
parenta4e7c15484a9330fb9e1a1b425fcf1b37bad04e1 (diff)
downloademacs-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.texi4
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/emacs-lisp/edebug.el12
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.
503Unset the breakpoint (if any) at the stop point at or after 503Unset the breakpoint (if any) at the stop point at or after
504point (@code{edebug-unset-breakpoint}). 504point (@code{edebug-unset-breakpoint}).
505 505
506@item U
507Unset 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}
507Set a conditional breakpoint which stops the program only if 511Set a conditional breakpoint which stops the program only if
508evaluating @var{condition} produces a non-@code{nil} value 512evaluating @var{condition} produces a non-@code{nil} value
diff --git a/etc/NEWS b/etc/NEWS
index b8c2c5a329c..aec27b93613 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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'
1467To 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
1467previously-set breakpoints. If the code has changed substantially, 1472previously-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)