[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6e72375 160/215: Merge pull request #111 from rocky/better
From: |
Rocky Bernstein |
Subject: |
[elpa] master 6e72375 160/215: Merge pull request #111 from rocky/better-breakpoint-highlighting |
Date: |
Sat, 30 Jul 2016 14:49:02 +0000 (UTC) |
branch: master
commit 6e72375bf8e845cf15f03daf89fe48063e471428
Merge: 480cbb3 5cc0037
Author: R. Bernstein <address@hidden>
Commit: R. Bernstein <address@hidden>
Merge pull request #111 from rocky/better-breakpoint-highlighting
Improve visibility of breakpoints
---
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 6f54316 161/215: Update README.md, (continued)
- [elpa] master 6f54316 161/215: Update README.md, Rocky Bernstein, 2016/07/30
- [elpa] master 51cd14b 173/215: Clarify %p in documentation of expand-format, Rocky Bernstein, 2016/07/30
- [elpa] master 13a3d4e 140/215: Minor docstring and code cleanups, Rocky Bernstein, 2016/07/30
- [elpa] master c919f96 115/215: Update IPDB in accordance with PDB, Rocky Bernstein, 2016/07/30
- [elpa] master 9358b1b 144/215: Merge pull request #104 from rocky/36-auto-attach, Rocky Bernstein, 2016/07/30
- [elpa] master 480cbb3 159/215: Remove leftover debugging message, Rocky Bernstein, 2016/07/30
- [elpa] master b2c9e67 156/215: Allow realgud-track-bp-delete to recognize multiple breakpoints, Rocky Bernstein, 2016/07/30
- [elpa] master c522acc 158/215: Merge pull request #110 from rocky/delete-multiple-breakpoints, Rocky Bernstein, 2016/07/30
- [elpa] master be7718a 073/215: Go over perldb init re's. Attempt smaller cleanup of tests and note how, Rocky Bernstein, 2016/07/30
- [elpa] master f08a894 170/215: Ensure that the Github organization logo is a square, Rocky Bernstein, 2016/07/30
- [elpa] master 6e72375 160/215: Merge pull request #111 from rocky/better-breakpoint-highlighting,
Rocky Bernstein <=
- [elpa] master a89d1b2 149/215: Rewrite README, Rocky Bernstein, 2016/07/30
- [elpa] master 90068ea 201/215: Simpler change to previous commit, Rocky Bernstein, 2016/07/30
- [elpa] master 524047e 163/215: Fix file-column-to-string in the presence of composed characters, Rocky Bernstein, 2016/07/30
- [elpa] master 4118834 207/215: Suppress irrelevant compilation warnings, Rocky Bernstein, 2016/07/30
- [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