[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 23b3032: New command to clear all breakpoints in a
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 23b3032: New command to clear all breakpoints in a function |
Date: |
Sun, 20 Oct 2019 07:40:13 -0400 (EDT) |
branch: master
commit 23b30327020c3f59691fbb20f061691c7bb15bdd
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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.
---
doc/lispref/edebug.texi | 4 ++++
etc/NEWS | 5 +++++
lisp/emacs-lisp/edebug.el | 12 ++++++++++++
3 files changed, 21 insertions(+)
diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi
index efbba40..e081833 100644
--- a/doc/lispref/edebug.texi
+++ b/doc/lispref/edebug.texi
@@ -503,6 +503,10 @@ program.
Unset the breakpoint (if any) at the stop point at or after
point (@code{edebug-unset-breakpoint}).
+@item U
+Unset any breakpoints in the current form
+(@code{edebug-unset-breakpoints}).
+
@item x @var{condition} @key{RET}
Set a conditional breakpoint which stops the program only if
evaluating @var{condition} produces a non-@code{nil} value
diff --git a/etc/NEWS b/etc/NEWS
index b8c2c5a..aec27b9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1462,6 +1462,11 @@ the Elisp manual for documentation of the new mode and
its commands.
** Edebug
++++
+*** New command 'edebug-unset-breakpoints'
+To clear all breakpoints in the current form, the 'U' command in
+'edebug-mode', or 'M-x edebug-unset-breakpoints' can be used.
+
---
*** Re-instrumenting a function with Edebug will now try to preserve
previously-set breakpoints. If the code has changed substantially,
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 68b2126..f591230 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."
(interactive)
(edebug-modify-breakpoint nil))
+(defun edebug-unset-breakpoints ()
+ "Unset all the breakpoints in the current form."
+ (interactive)
+ (let* ((name (edebug-form-data-symbol))
+ (breakpoints (nth 1 (get name 'edebug))))
+ (unless breakpoints
+ (user-error "There are no breakpoints in %s" name))
+ (save-excursion
+ (dolist (breakpoint breakpoints)
+ (goto-char (nth 3 breakpoint))
+ (edebug-modify-breakpoint nil)))))
(defun edebug-set-global-break-condition (expression)
"Set `edebug-global-break-condition' to EXPRESSION."
@@ -3756,6 +3767,7 @@ be installed in `emacs-lisp-mode-map'.")
;; breakpoints
(define-key map "b" 'edebug-set-breakpoint)
(define-key map "u" 'edebug-unset-breakpoint)
+ (define-key map "U" 'edebug-unset-breakpoints)
(define-key map "B" 'edebug-next-breakpoint)
(define-key map "x" 'edebug-set-conditional-breakpoint)
(define-key map "X" 'edebug-set-global-break-condition)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 23b3032: New command to clear all breakpoints in a function,
Lars Ingebrigtsen <=