Set a breakpoint at the stop point at or after point
(@code{edebug-set-breakpoint}). If you use a prefix argument, the
breakpoint is temporary---it turns off the first time it stops the
-program. An overlay with the @code{edebug-breakpoint} face is put at
-the breakpoint.
+program. An overlay with the @code{edebug-enabled-breakpoint} or
+@code{edebug-disabled-breakpoint} faces is put at the breakpoint.
@item u
Unset the breakpoint (if any) at the stop point at or after
Unset any breakpoints in the current form
(@code{edebug-unset-breakpoints}).
+@item D
+Toggle whether to disable the breakpoint near point
+(@code{edebug-toggle-disable-breakpoint}). This command is mostly
+useful if the breakpoint is conditional and it would take some work to
+recreate the condition.
+
@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
"A source-level debugger for Emacs Lisp."
:group 'lisp)
-(defface edebug-breakpoint '((t :inherit highlight))
- "Face used to mark breakpoints."
+(defface edebug-enabled-breakpoint '((t :inherit highlight))
+ "Face used to mark enabled breakpoints."
+ :version "27.1")
+
+(defface edebug-disabled-breakpoint
+ '((((class color) (min-colors 88) (background light))
+ :background "#ddffdd" :extend t)
+ (((class color) (min-colors 88) (background dark))
+ :background "#335533" :extend t))
+ "Face used to mark disabled breakpoints."
:version "27.1")
(defcustom edebug-setup-hook nil
(edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints
(edebug-break-data (assq offset-index edebug-breakpoints))
(edebug-break-condition (car (cdr edebug-break-data)))
+ (breakpoint-disabled (nth 4 edebug-break-data))
(edebug-global-break
(if edebug-global-break-condition
(condition-case nil
(setq edebug-break
(or edebug-global-break
(and edebug-break-data
+ (not breakpoint-disabled)
(or (not edebug-break-condition)
(setq edebug-break-result
(edebug-eval edebug-break-condition))))))
(edebug-sort-alist
(cons
(list index condition temporary
- (set-marker (make-marker) position))
+ (set-marker (make-marker) position)
+ nil)
edebug-breakpoints)
'<))
(if condition
(let* ((pos (+ start (aref offsets (car breakpoint))))
(overlay (make-overlay pos (1+ pos))))
(overlay-put overlay 'edebug t)
- (overlay-put overlay 'face 'edebug-breakpoint))))))
+ (overlay-put overlay 'face
+ (if (nth 4 breakpoint)
+ 'edebug-disabled-breakpoint
+ 'edebug-enabled-breakpoint)))))))
(defun edebug--overlay-breakpoints-remove (start end)
(dolist (overlay (overlays-in start end))
(goto-char (nth 3 breakpoint))
(edebug-modify-breakpoint nil)))))
+(defun edebug-toggle-disable-breakpoint ()
+ "Toggle whether the breakpoint near point is disabled."
+ (interactive)
+ (let ((stop-point (edebug-find-stop-point)))
+ (unless stop-point
+ (user-error "No stop point near point"))
+ (let* ((name (car stop-point))
+ (index (cdr stop-point))
+ (data (get name 'edebug))
+ (breakpoint (assq index (nth 1 data))))
+ (unless breakpoint
+ (user-error "No breakpoint near point"))
+ (setf (nth 4 breakpoint)
+ (not (nth 4 breakpoint)))
+ (edebug--overlay-breakpoints name))))
+
(defun edebug-set-global-break-condition (expression)
"Set `edebug-global-break-condition' to EXPRESSION."
(interactive
(define-key map "B" 'edebug-next-breakpoint)
(define-key map "x" 'edebug-set-conditional-breakpoint)
(define-key map "X" 'edebug-set-global-break-condition)
+ (define-key map "D" 'edebug-toggle-disable-breakpoint)
;; evaluation
(define-key map "r" 'edebug-previous-result)
;; 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 "x" 'edebug-set-conditional-breakpoint)
(define-key map "X" 'edebug-set-global-break-condition)
+ (define-key map "D" 'edebug-toggle-disable-breakpoint)
;; views
(define-key map "w" 'edebug-where)
("Breaks"
["Set Breakpoint" edebug-set-breakpoint t]
["Unset Breakpoint" edebug-unset-breakpoint t]
+ ["Unset Breakpoints In Form" edebug-unset-breakpoints t]
+ ["Toggle Disable Breakpoint" edebug-toggle-disable-breakpoint t]
["Set Conditional Breakpoint" edebug-set-conditional-breakpoint t]
["Set Global Break Condition" edebug-set-global-break-condition t]
["Show Next Breakpoint" edebug-next-breakpoint t])