[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5cc0037 157/215: Improve visibility of breakpoints
From: |
Rocky Bernstein |
Subject: |
[elpa] master 5cc0037 157/215: Improve visibility of breakpoints |
Date: |
Sat, 30 Jul 2016 14:49:02 +0000 (UTC) |
branch: master
commit 5cc0037e1eea3256ecfdec5096e22cb632e6134a
Author: Clément Pit--Claudel <address@hidden>
Commit: Clément Pit--Claudel <address@hidden>
Improve visibility of breakpoints
Default to a (larger) rectangle instead of a circle, and highlight full
line on active breakpoints.
Addresses parts of the discussion in #102.
---
realgud/common/bp.el | 61 +++++++++++++++++++++++++++++++-------------------
1 file changed, 38 insertions(+), 23 deletions(-)
diff --git a/realgud/common/bp.el b/realgud/common/bp.el
index 4de307a..f5e4c9d 100644
--- a/realgud/common/bp.el
+++ b/realgud/common/bp.el
@@ -80,15 +80,27 @@ overlay for a realgud property."
(defface realgud-bp-enabled-face
'((t :foreground "red" :weight bold))
- "Face for enabled breakpoints."
+ "Face for enabled breakpoints (in the fringe or margin)."
:group 'realgud-bp)
(defface realgud-bp-disabled-face
'((t :foreground "grey" :weight bold))
- "Face for disabled breakpoints."
+ "Face for disabled breakpoints (in the fringe or margin).
+Only used in text terminals: fringe icons always use
+`realgud-bp-enabled-face'."
:group 'realgud-bp)
-(defcustom realgud-bp-fringe-indicator-style '(realgud-bp-filled .
realgud-bp-hollow)
+(defface realgud-bp-line-enabled-face
+ '((t :inherit diff-removed))
+ "Face for lines with enabled breakpoints."
+ :group 'realgud-bp)
+
+(defface realgud-bp-line-disabled-face
+ '((t))
+ "Face for lines with disabled breakpoints."
+ :group 'realgud-bp)
+
+(defcustom realgud-bp-fringe-indicator-style '(filled-rectangle .
hollow-rectangle)
"Which fringe icon to use for breakpoints."
:type '(choice (const :tag "Disc" (realgud-bp-filled . realgud-bp-hollow))
(const :tag "Square" (filled-square . hollow-square))
@@ -108,15 +120,14 @@ If nil, use margins instead."
(and window (car (window-fringes window)))
0)))
-(defun realgud-bp-add-fringe-icon (overlay icon face)
+(defun realgud-bp-add-fringe-icon (overlay icon)
"Add a fringe icon to OVERLAY.
-ICON is a fringe icon symbol; the corresponding icon gets
-highlighted with FACE."
+ICON is a symbol registered with `define-fringe-bitmap'."
;; Ensure that the fringe is wide enough
(unless (>= (realgud-bp--fringe-width) 8)
(set-fringe-mode `(8 . ,right-fringe-width)))
;; Add the fringe icon
- (let* ((fringe-spec `(left-fringe ,icon ,face)))
+ (let* ((fringe-spec `(left-fringe ,icon realgud-bp-enabled-face)))
(overlay-put overlay 'before-string (propertize "x" 'display
fringe-spec))))
(defun realgud-bp-add-margin-indicator (overlay text image face)
@@ -136,34 +147,38 @@ highlighted with FACE."
(spec `((margin left-margin) ,indicator)))
(overlay-put overlay 'before-string (propertize text 'display spec))))
-(defun realgud-bp-put-icon (pos enabled bp-num &optional buf)
+(defun realgud-bp-put-icon (pos enable? bp-num &optional buf)
"Add a breakpoint icon at POS according to breakpoint-display-style.
Use the fringe if available, and the margin otherwise. Record
-breakpoint status ENABLED and breakpoint number BP-NUM in
+breakpoint status ENABLE? and breakpoint number BP-NUM in
overlay. BUF is the buffer that POS refers to; it detaults to
the current buffer."
- (let* ((margin-text) (face) (margin-icon) (fringe-icon))
+ (let* ((bp-text) (bp-face) (line-face) (margin-icon) (fringe-icon))
(realgud-set-bp-icons)
- (if enabled
- (setq margin-text "B"
- face 'realgud-bp-enabled-face
+ (if enable?
+ (setq bp-text "B"
+ bp-face 'realgud-bp-enabled-face
+ line-face 'realgud-bp-line-enabled-face
margin-icon realgud-bp-enabled-icon
fringe-icon (car realgud-bp-fringe-indicator-style))
- (setq margin-text "b"
- face 'realgud-bp-disabled-face
+ (setq bp-text "b"
+ bp-face 'realgud-bp-disabled-face
+ line-face 'realgud-bp-line-disabled-face
margin-icon realgud-bp-disabled-icon
fringe-icon (cdr realgud-bp-fringe-indicator-style)))
- (let ((help-echo (format "%s%s: mouse-1 to clear" margin-text bp-num)))
- (setq margin-text (propertize margin-text 'help-echo help-echo)))
+ (let ((help-echo (format "%s%s: mouse-1 to clear" bp-text bp-num)))
+ (setq bp-text (propertize bp-text 'help-echo help-echo)))
(with-current-buffer (or buf (current-buffer))
- (realgud-bp-remove-icons pos pos bp-num)
- (let ((ov (make-overlay pos pos (current-buffer) t nil)))
+ (realgud-bp-remove-icons pos (1+ pos) bp-num)
+ (let* ((eol (save-excursion (goto-char pos) (point-at-eol)))
+ (ov (make-overlay pos (1+ eol) (current-buffer) t nil)))
(if (and realgud-bp-use-fringe (display-images-p))
- (realgud-bp-add-fringe-icon ov fringe-icon face)
- (realgud-bp-add-margin-indicator ov margin-text margin-icon face))
+ (realgud-bp-add-fringe-icon ov fringe-icon)
+ (realgud-bp-add-margin-indicator ov bp-text margin-icon bp-face))
+ (overlay-put ov 'face line-face)
(overlay-put ov 'realgud t)
(overlay-put ov 'realgud-bp-num bp-num)
- (overlay-put ov 'realgud-bp-enabled enabled)))))
+ (overlay-put ov 'realgud-bp-enabled enable?)))))
(defun realgud-bp-del-icon (pos &optional buf bpnum)
"Delete breakpoint icon at POS.
@@ -171,7 +186,7 @@ BUF is the buffer which pos refers to (default: current
buffer).
If BPNUM is non-nil, only remove overlays maching that breakpoint
number."
(with-current-buffer (or buf (current-buffer))
- (realgud-bp-remove-icons pos pos bpnum)))
+ (realgud-bp-remove-icons pos (1+ pos) bpnum)))
(defun realgud-bp-add-info (loc)
"Record bp information for location LOC."
- [elpa] master 0a17ada 079/215: Fix several issues when calling gdb, Fixes #59, (continued)
- [elpa] master 0a17ada 079/215: Fix several issues when calling gdb, Fixes #59, Rocky Bernstein, 2016/07/30
- [elpa] master bc1f4ba 194/215: Broaden trepan breakpoint search, Rocky Bernstein, 2016/07/30
- [elpa] master 277e10c 167/215: Merge pull request #113 from rocky/logo, Rocky Bernstein, 2016/07/30
- [elpa] master 7211cc5 192/215: Restart should be a confirm command too., Rocky Bernstein, 2016/07/30
- [elpa] master 32fb382 190/215: Merge pull request #126 from realgud/103-jump, Rocky Bernstein, 2016/07/30
- [elpa] master ba2b69c 202/215: Remove code added by mistake, Rocky Bernstein, 2016/07/30
- [elpa] master 4862a6f 206/215: Warn if gdb --interpreter=mi or -i mi is used, Rocky Bernstein, 2016/07/30
- [elpa] master 1e257cf 209/215: One more FSF copyright assignment, Rocky Bernstein, 2016/07/30
- [elpa] master ba3b013 103/215: Merge branch 'ipdb' of https://github.com/seanfarley/emacs-dbgr into ipdb, Rocky Bernstein, 2016/07/30
- [elpa] master b405494 191/215: Fill out pdb-remote execution, Rocky Bernstein, 2016/07/30
- [elpa] master 5cc0037 157/215: Improve visibility of breakpoints,
Rocky Bernstein <=
- [elpa] master e5a2331 153/215: Handle enable/disable bp status messages - 1st cut, Rocky Bernstein, 2016/07/30
- [elpa] master ec23a09 164/215: Slightly shorten setup instructions in README, Rocky Bernstein, 2016/07/30
- [elpa] master f7947aa 131/215: Rename realgud:prompt-if-{prefix-or-, }safe-mode, Rocky Bernstein, 2016/07/30
- [elpa] master eaae9f1 142/215: Update commentary; e.g. link to debuggers handled, Rocky Bernstein, 2016/07/30
- [elpa] master 7c6fab2 166/215: New RealGUD logo, Rocky Bernstein, 2016/07/30
- [elpa] master cc32bab 200/215: Correct realgud:gdb-pid-associate call, Rocky Bernstein, 2016/07/30
- [elpa] master 8e5eaaf 128/215: Merge pull request #94 from rocky/84-fix-autoloads, Rocky Bernstein, 2016/07/30
- [elpa] master 2c31d58 154/215: Typo, Rocky Bernstein, 2016/07/30
- [elpa] master 64bd779 155/215: Alway late on this kind of thing., Rocky Bernstein, 2016/07/30
- [elpa] master b6407b9 197/215: Merge pull request #130 from realgud/enable-disable, Rocky Bernstein, 2016/07/30