# HG changeset patch # User Nick Roberts # Date 1128947104 0 # Node ID 8bd4c2112a500934497637fbbd3dbef3f4ffba6b # Parent 9b0a56e1bd57a64fa2691fc54d717695cd43d67c (gud-install-speedbar-variables): Add more bindings. (gud-speedbar-buttons): Preserve point if possible. (gud-sentinel): Restore previous speedbar display type. diff -r 9b0a56e1bd57 -r 8bd4c2112a50 lisp/progmodes/gud.el --- 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)))