changeset 66419:5da1cd84fb2c

(gdb-mouse-until): New function. (gdb-ann3): Bind it to mouse-2 and drag-mouse-1 in left fringe.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 25 Oct 2005 02:30:39 +0000
parents 78ad7c173e94
children bfef75322aba
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Tue Oct 25 02:21:28 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Oct 25 02:30:39 2005 +0000
@@ -349,6 +349,10 @@
     'gdb-mouse-set-clear-breakpoint)
   (define-key gud-minor-mode-map [left-fringe mouse-1]
     'gdb-mouse-set-clear-breakpoint)
+  (define-key gud-minor-mode-map [left-fringe mouse-2]
+    'gdb-mouse-until)
+  (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
+    'gdb-mouse-until)
   (define-key gud-minor-mode-map [left-margin mouse-3]
     'gdb-mouse-toggle-breakpoint-margin)
   (define-key gud-minor-mode-map [left-fringe mouse-3]
@@ -396,6 +400,21 @@
   (gdb-set-gud-minor-mode-existing-buffers)
   (run-hooks 'gdba-mode-hook))
 
+(defun gdb-mouse-until (event)
+  "Execute source lines by dragging the overlay arrow (fringe) with the mouse."
+  (interactive "e")
+  (if gud-overlay-arrow-position
+	(let ((start (event-start event))
+	      (end  (event-end event))
+	      (buffer (marker-buffer gud-overlay-arrow-position)) (line))
+	  (if (equal buffer (window-buffer (posn-window end)))
+	      (with-current-buffer buffer
+		(when (or (equal start end)
+			  (equal (posn-point start)
+				 (marker-position gud-overlay-arrow-position)))
+		  (setq line (line-number-at-pos (posn-point end)))
+		  (gud-call (concat "until " (number-to-string line)))))))))
+
 (defcustom gdb-use-colon-colon-notation nil
   "If non-nil use FUN::VAR format to display variables in the speedbar."
   :type 'boolean