]> git.eshelyaron.com Git - emacs.git/commitdiff
(gud-speedbar-buttons): Update properly for
authorNick Roberts <nickrob@snap.net.nz>
Sat, 18 Feb 2006 22:57:05 +0000 (22:57 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Sat, 18 Feb 2006 22:57:05 +0000 (22:57 +0000)
shadow face.  Don't provide binding to edit variable when it is
out of scope.

lisp/progmodes/gud.el

index a5ed1217f94d1a936aa36e3ac7b25041a487cc2b..3b441d0c2964829572144d376a801ee896496590 100644 (file)
@@ -453,46 +453,55 @@ required by the caller."
          (insert "Watch Expressions:\n")
          (if gdb-speedbar-auto-raise
              (raise-frame speedbar-frame))
-         (let ((var-list gdb-var-list))
+         (let ((var-list gdb-var-list) parent)
            (while var-list
-             (let* (char (depth 0) (start 0)
-                    (var (car var-list)) (varnum (nth 1 var)))
+             (let* (char (depth 0) (start 0) (var (car var-list))
+                         (varnum (nth 1 var)) (status (nth 5 var)))
                (while (string-match "\\." varnum start)
                  (setq depth (1+ depth)
                        start (1+ (match-beginning 0))))
+               (if (eq depth 0) (setq parent nil))
                (if (or (equal (nth 2 var) "0")
                        (and (equal (nth 2 var) "1")
                             (string-match "char \\*$" (nth 3 var))))
-                   (speedbar-make-tag-line 'bracket ?? nil nil
-                                           (concat (car var) "\t" (nth 4 var))
-                                           'gdb-edit-value
-                                           nil
-                      (if gdb-show-changed-values
-                          (case (nth 5 var)
-                                (changed 'font-lock-warning-face)
-                                (out-of-scope 'shadow)
-                                (nil nil))
-                        nil) depth)
+                   (speedbar-make-tag-line
+                    'bracket ?? nil nil
+                    (concat (car var) "\t" (nth 4 var))
+                    (if (or parent (eq status 'out-of-scope))
+                        nil 'gdb-edit-value)
+                    nil
+                    (if gdb-show-changed-values
+                        (or parent (case status
+                                     (changed 'font-lock-warning-face)
+                                     (out-of-scope 'shadow)
+                                     (nil nil)))
+                      nil) depth)
+                 (if (eq status 'out-of-scope) (setq parent 'shadow))
                  (if (and (cadr var-list)
                           (string-match (concat varnum "\\.")
                                         (cadr (cadr var-list))))
                      (setq char ?-)
                    (setq char ?+))
                  (if (string-match "\\*$" (nth 3 var))
-                     (speedbar-make-tag-line 'bracket char
-                                             'gdb-speedbar-expand-node varnum
-                                             (concat (car var) "\t"
-                                                     (nth 3 var)"\t"
-                                                     (nth 4 var))
-                                             'gdb-edit-value nil
-                                             (if (and (nth 5 var)
-                                                      gdb-show-changed-values)
-                                                 'font-lock-warning-face
-                                               nil) depth)
-                 (speedbar-make-tag-line 'bracket char
-                                         'gdb-speedbar-expand-node varnum
-                                         (concat (car var) "\t" (nth 3 var))
-                                         nil nil nil depth))))
+                     (speedbar-make-tag-line
+                      'bracket char
+                      'gdb-speedbar-expand-node varnum
+                      (concat (car var) "\t"
+                              (nth 3 var)"\t"
+                              (nth 4 var))
+                      (if (or parent status 'out-of-scope)
+                        nil 'gdb-edit-value)
+                      nil
+                      (if (and status gdb-show-changed-values)
+                          'shadow nil)
+                      depth)
+                   (speedbar-make-tag-line
+                    'bracket char
+                    'gdb-speedbar-expand-node varnum
+                    (concat (car var) "\t" (nth 3 var))
+                    nil nil
+                    (if (and (nth 5 var) gdb-show-changed-values) 'shadow nil)
+                    depth))))
              (setq var-list (cdr var-list))))
          (setq gdb-var-changed nil)))
        (t (unless (and (save-excursion