aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2006-05-04 05:17:45 +0000
committerNick Roberts2006-05-04 05:17:45 +0000
commit0c9512fecc708886ca19ff52b1022c86170fc613 (patch)
treef846ed6588d9a9af4c076b01eeac05177f8e3ffb
parent6f095055992caafb394c64130a1322bf4c1c67f5 (diff)
downloademacs-0c9512fecc708886ca19ff52b1022c86170fc613.tar.gz
emacs-0c9512fecc708886ca19ff52b1022c86170fc613.zip
(gdb-force-update): Delete defvar
(gud-speedbar-buttons): ...and references to it. Use window-start to try to keep positon in watch expression.
-rw-r--r--lisp/progmodes/gud.el114
1 files changed, 55 insertions, 59 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 11259aa3965..5be88668353 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -49,7 +49,6 @@
49(defvar gdb-macro-info) 49(defvar gdb-macro-info)
50(defvar gdb-server-prefix) 50(defvar gdb-server-prefix)
51(defvar gdb-show-changed-values) 51(defvar gdb-show-changed-values)
52(defvar gdb-force-update)
53(defvar gdb-var-list) 52(defvar gdb-var-list)
54(defvar gdb-speedbar-auto-raise) 53(defvar gdb-speedbar-auto-raise)
55(defvar tool-bar-map) 54(defvar tool-bar-map)
@@ -442,37 +441,55 @@ required by the caller."
442 (buffer-name gud-comint-buffer)) 441 (buffer-name gud-comint-buffer))
443 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode)) 442 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
444 (window (get-buffer-window (current-buffer) 0)) 443 (window (get-buffer-window (current-buffer) 0))
444 (start (window-start window))
445 (p (window-point window))) 445 (p (window-point window)))
446 (cond 446 (cond
447 ((memq minor-mode '(gdbmi gdba)) 447 ((memq minor-mode '(gdbmi gdba))
448 (when (or gdb-force-update 448 (erase-buffer)
449 (not (save-excursion 449 (insert "Watch Expressions:\n")
450 (goto-char (point-min)) 450 (if gdb-speedbar-auto-raise
451 (looking-at "Watch Expressions:")))) 451 (raise-frame speedbar-frame))
452 (erase-buffer) 452 (let ((var-list gdb-var-list) parent)
453 (insert "Watch Expressions:\n") 453 (while var-list
454 (if gdb-speedbar-auto-raise 454 (let* (char (depth 0) (start 0) (var (car var-list))
455 (raise-frame speedbar-frame)) 455 (varnum (car var)) (expr (nth 1 var))
456 (let ((var-list gdb-var-list) parent) 456 (type (nth 3 var)) (value (nth 4 var))
457 (while var-list 457 (status (nth 5 var)))
458 (let* (char (depth 0) (start 0) (var (car var-list)) 458 (put-text-property
459 (varnum (car var)) (expr (nth 1 var)) 459 0 (length expr) 'face font-lock-variable-name-face expr)
460 (type (nth 3 var)) (value (nth 4 var)) 460 (put-text-property
461 (status (nth 5 var))) 461 0 (length type) 'face font-lock-type-face type)
462 (put-text-property 462 (while (string-match "\\." varnum start)
463 0 (length expr) 'face font-lock-variable-name-face expr) 463 (setq depth (1+ depth)
464 (put-text-property 464 start (1+ (match-beginning 0))))
465 0 (length type) 'face font-lock-type-face type) 465 (if (eq depth 0) (setq parent nil))
466 (while (string-match "\\." varnum start) 466 (if (or (equal (nth 2 var) "0")
467 (setq depth (1+ depth) 467 (and (equal (nth 2 var) "1")
468 start (1+ (match-beginning 0)))) 468 (string-match "char \\*$" type)))
469 (if (eq depth 0) (setq parent nil)) 469 (speedbar-make-tag-line
470 (if (or (equal (nth 2 var) "0") 470 'bracket ?? nil nil
471 (and (equal (nth 2 var) "1") 471 (concat expr "\t" value)
472 (string-match "char \\*$" type))) 472 (if (or parent (eq status 'out-of-scope))
473 nil 'gdb-edit-value)
474 nil
475 (if gdb-show-changed-values
476 (or parent (case status
477 (changed 'font-lock-warning-face)
478 (out-of-scope 'shadow)
479 (t t)))
480 t)
481 depth)
482 (if (eq status 'out-of-scope) (setq parent 'shadow))
483 (if (and (nth 1 var-list)
484 (string-match (concat varnum "\\.")
485 (car (nth 1 var-list))))
486 (setq char ?-)
487 (setq char ?+))
488 (if (string-match "\\*$" type)
473 (speedbar-make-tag-line 489 (speedbar-make-tag-line
474 'bracket ?? nil nil 490 'bracket char
475 (concat expr "\t" value) 491 'gdb-speedbar-expand-node varnum
492 (concat expr "\t" type "\t" value)
476 (if (or parent (eq status 'out-of-scope)) 493 (if (or parent (eq status 'out-of-scope))
477 nil 'gdb-edit-value) 494 nil 'gdb-edit-value)
478 nil 495 nil
@@ -483,37 +500,15 @@ required by the caller."
483 (t t))) 500 (t t)))
484 t) 501 t)
485 depth) 502 depth)
486 (if (eq status 'out-of-scope) (setq parent 'shadow)) 503 (speedbar-make-tag-line
487 (if (and (nth 1 var-list) 504 'bracket char
488 (string-match (concat varnum "\\.") 505 'gdb-speedbar-expand-node varnum
489 (car (nth 1 var-list)))) 506 (concat expr "\t" type)
490 (setq char ?-) 507 nil nil
491 (setq char ?+)) 508 (if (and (or parent status) gdb-show-changed-values)
492 (if (string-match "\\*$" type) 509 'shadow t)
493 (speedbar-make-tag-line 510 depth))))
494 'bracket char 511 (setq var-list (cdr var-list)))))
495 'gdb-speedbar-expand-node varnum
496 (concat expr "\t" type "\t" value)
497 (if (or parent (eq status 'out-of-scope))
498 nil 'gdb-edit-value)
499 nil
500 (if gdb-show-changed-values
501 (or parent (case status
502 (changed 'font-lock-warning-face)
503 (out-of-scope 'shadow)
504 (t t)))
505 t)
506 depth)
507 (speedbar-make-tag-line
508 'bracket char
509 'gdb-speedbar-expand-node varnum
510 (concat expr "\t" type)
511 nil nil
512 (if (and (or parent status) gdb-show-changed-values)
513 'shadow t)
514 depth))))
515 (setq var-list (cdr var-list))))
516 (setq gdb-force-update nil)))
517 (t (unless (and (save-excursion 512 (t (unless (and (save-excursion
518 (goto-char (point-min)) 513 (goto-char (point-min))
519 (looking-at "Current Stack:")) 514 (looking-at "Current Stack:"))
@@ -544,6 +539,7 @@ required by the caller."
544 (t (error "Should never be here"))) 539 (t (error "Should never be here")))
545 frame t)))) 540 frame t))))
546 (setq gud-last-speedbar-stackframe gud-last-last-frame)))) 541 (setq gud-last-speedbar-stackframe gud-last-last-frame))))
542 (set-window-start window start)
547 (set-window-point window p)))) 543 (set-window-point window p))))
548 544
549 545