changeset 54130:aae5a270e964

(gud-install-speedbar-variables): Bind gdb-var-delete to "D". (gud-speedbar-menu-items): Add gdb-var-delete and, indirectly, gdb-edit-value. (gud-speedbar-buttons): Remove gdb-var-delete from tag-line. (gud-gdb-marker-filter): Add comment for annotations.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 23 Feb 2004 00:42:31 +0000
parents 12793b62539c
children 6534ec3bbe32
files lisp/progmodes/gud.el
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Mon Feb 23 00:41:44 2004 +0000
+++ b/lisp/progmodes/gud.el	Mon Feb 23 00:42:31 2004 +0000
@@ -305,11 +305,18 @@
 
     (define-key gud-speedbar-key-map "j" 'speedbar-edit-line)
     (define-key gud-speedbar-key-map "e" 'speedbar-edit-line)
-    (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)))
+    (define-key gud-speedbar-key-map "\C-m" 'speedbar-edit-line)
+    (define-key gud-speedbar-key-map "D" 'gdb-var-delete)))
+
 
 (defvar gud-speedbar-menu-items
   ;; Note to self.  Add expand, and turn off items when not available.
-  '(["Jump to stack frame" speedbar-edit-line t])
+  '(["Jump to stack frame" speedbar-edit-line 
+     (with-current-buffer gud-comint-buffer (not (eq gud-minor-mode 'gdba)))]
+    ["Edit value" speedbar-edit-line 
+     (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))]
+    ["Delete expression" gdb-var-delete 
+     (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))])
   "Additional menu items to add to the speedbar frame.")
 
 ;; Make sure our special speedbar mode is loaded
@@ -353,8 +360,7 @@
 		(speedbar-make-tag-line 'bracket char
 					'gdb-speedbar-expand-node varnum
 					(concat (car var) "\t" (nth 3 var))
-					'gdb-var-delete
-					nil nil depth)))
+					nil nil nil depth)))
 	    (setq var-list (cdr var-list))))
 	(setq gdb-var-changed nil)))
      (t (if (and (save-excursion
@@ -450,10 +456,13 @@
        ;; Set the accumulator to the remaining text.
        gud-marker-acc (substring gud-marker-acc (match-end 0))))
 
+    ;; Check for annotations and change gud-minor-mode to 'gdba if
+    ;; they are found.
     (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
       (when (string-equal (match-string 1 gud-marker-acc) "prompt")
 	(require 'gdb-ui)
 	(gdb-prompt nil))
+
       (setq
        ;; Append any text before the marker to the output we're going
        ;; to return - we don't include the marker in this text.