]> git.eshelyaron.com Git - emacs.git/commitdiff
Add fringe markers to edebug breakpoints
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Oct 2019 20:17:12 +0000 (22:17 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 21 Oct 2019 20:22:16 +0000 (22:22 +0200)
* lisp/emacs-lisp/edebug.el (edebug--overlay-breakpoints): Set a
fringe element to mark the breakpoint.
(edebug-breakpoint): Fringe marker.

lisp/emacs-lisp/edebug.el

index a646ce6febe56a91e5bc68914013c0e4be3c034a..0c3164b5cb82bbfa167893be419c0bf8f44f0405 100644 (file)
@@ -3232,6 +3232,9 @@ the breakpoint."
          (goto-char position)
           (edebug--overlay-breakpoints edebug-def-name)))))
 
+(define-fringe-bitmap 'edebug-breakpoint
+  "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
+
 (defun edebug--overlay-breakpoints (function)
   (let* ((data (get function 'edebug))
          (start (nth 0 data))
@@ -3245,12 +3248,22 @@ the breakpoint."
     (when edebug-active
       (dolist (breakpoint breakpoints)
         (let* ((pos (+ start (aref offsets (car breakpoint))))
-               (overlay (make-overlay pos (1+ pos))))
+               (overlay (make-overlay pos (1+ pos)))
+               (face (if (nth 4 breakpoint)
+                         (progn
+                           (overlay-put overlay
+                                        'help-echo "Disabled breakpoint")
+                           (overlay-put overlay
+                                        'face 'edebug-disabled-breakpoint))
+                       (overlay-put overlay 'help-echo "Breakpoint")
+                       (overlay-put overlay 'face 'edebug-enabled-breakpoint))))
           (overlay-put overlay 'edebug t)
-          (overlay-put overlay 'face
-                       (if (nth 4 breakpoint)
-                           'edebug-disabled-breakpoint
-                         'edebug-enabled-breakpoint)))))))
+          (let ((fringe (make-overlay pos pos (current-buffer))))
+            (overlay-put fringe 'edebug t)
+            (overlay-put fringe 'before-string
+                         (propertize
+                          "x" 'display
+                          `(left-fringe edebug-breakpoint ,face)))))))))
 
 (defun edebug--overlay-breakpoints-remove (start end)
   (dolist (overlay (overlays-in start end))