changeset 65972:8bd4c2112a50

(gud-install-speedbar-variables): Add more bindings. (gud-speedbar-buttons): Preserve point if possible. (gud-sentinel): Restore previous speedbar display type.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 10 Oct 2005 12:25:04 +0000
parents 9b0a56e1bd57
children ae4953c24452
files lisp/progmodes/gud.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Mon Oct 10 12:23:44 2005 +0000
+++ b/lisp/progmodes/gud.el	Mon Oct 10 12:25:04 2005 +0000
@@ -352,6 +352,9 @@
     (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 " " 'speedbar-toggle-line-expansion)
+    (define-key gud-speedbar-key-map "[" 'speedbar-expand-line-descendants)
+    (define-key gud-speedbar-key-map "]" 'speedbar-contract-line-descendants)
     (define-key gud-speedbar-key-map "D" 'gdb-var-delete))
 
   (speedbar-add-expansion-list '("GUD" gud-speedbar-menu-items
@@ -389,7 +392,9 @@
 	     gud-comint-buffer
 	     ;; gud-comint-buffer might be killed
 	     (buffer-name gud-comint-buffer))
-    (let ((minor-mode (with-current-buffer buffer gud-minor-mode)))
+    (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
+	  (window (get-buffer-window (current-buffer) 0))
+	  (p (window-point window)))
       (cond
        ((memq minor-mode '(gdbmi gdba))
 	(when (or gdb-var-changed
@@ -454,7 +459,8 @@
 			'gud-gdb-goto-stackframe)
 		       (t (error "Should never be here")))
 		 frame t))))
-	    (setq gud-last-speedbar-stackframe gud-last-last-frame)))))))
+	    (setq gud-last-speedbar-stackframe gud-last-last-frame))))
+      (set-window-point window p))))
 
 
 ;; ======================================================================
@@ -2569,6 +2575,9 @@
 	 ;; Stop displaying an arrow in a source file.
 	 (setq gud-overlay-arrow-position nil)
 	 (set-process-buffer proc nil)
+	 (if (featurep 'speedbar)
+	     (speedbar-change-initial-expansion-list
+	      speedbar-previously-used-expansion-list-name))
 	 (if (memq gud-minor-mode-type '(gdbmi gdba))
 	     (gdb-reset)
 	   (gud-reset)))