changeset 66923:830bec4c85bb

(gud-speedbar-item-info): New function. (gud-install-speedbar-variables): Use it to display data types of watch expression as tooltips in speedbar.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 16 Nov 2005 11:26:34 +0000
parents c045303407bb
children 53960d1c1f2f
files lisp/progmodes/gud.el
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Wed Nov 16 11:25:18 2005 +0000
+++ b/lisp/progmodes/gud.el	Wed Nov 16 11:26:34 2005 +0000
@@ -371,6 +371,12 @@
 (defvar gud-speedbar-key-map nil
   "Keymap used when in the buffers display mode.")
 
+(defun gud-speedbar-item-info ()
+  "Display the data type of the watch expression element."
+  (let ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)))
+    (if (nth 4 var)
+	(speedbar-message "%s" (nth 3 var)))))
+
 (defun gud-install-speedbar-variables ()
   "Install those variables used by speedbar to enhance gud/gdb."
   (if gud-speedbar-key-map
@@ -387,7 +393,12 @@
 
   (speedbar-add-expansion-list '("GUD" gud-speedbar-menu-items
 				 gud-speedbar-key-map
-				 gud-expansion-speedbar-buttons)))
+				 gud-expansion-speedbar-buttons))
+
+  (add-to-list 
+   'speedbar-mode-functions-list
+   '("GUD" (speedbar-item-info . gud-speedbar-item-info)
+     (speedbar-line-directory . ignore))))
 
 (defvar gud-speedbar-menu-items
   '(["Jump to stack frame" speedbar-edit-line