From: Nick Roberts Date: Sat, 11 Jan 2003 16:46:35 +0000 (+0000) Subject: (gud-kill-buffer-hook): Save gud-minor-mode type. X-Git-Tag: ttn-vms-21-2-B4~11744 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=703ce2c3f983cef71943077707085bac8be749f9;p=emacs.git (gud-kill-buffer-hook): Save gud-minor-mode type. (gud-reset): New function. Reset environment at end of debugging. (gud-sentinel): Call gud-reset or gdb-reset. --- diff --git a/lisp/gud.el b/lisp/gud.el index 2842ce09ab1..5a6f0a7fdd2 100644 --- a/lisp/gud.el +++ b/lisp/gud.el @@ -2427,10 +2427,17 @@ It is saved for when this flag is not set.") ;; buffer killed ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) - (set-process-buffer proc nil)) + (set-process-buffer proc nil) + (if (eq gud-minor-mode-type 'gdba) + (gdb-reset) + (gud-reset))) ((memq (process-status proc) '(signal exit)) ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) + (with-current-buffer gud-comint-buffer + (if (eq gud-minor-mode 'gdba) + (gdb-reset) + (gud-reset))) (let* ((obuf (current-buffer))) ;; save-excursion isn't the right thing if ;; process-buffer is current-buffer @@ -2456,6 +2463,23 @@ It is saved for when this flag is not set.") ;; if obuf is the gud buffer. (set-buffer obuf)))))) +(defvar gud-minor-mode-type nil) + +(defun gud-kill-buffer-hook () + (if gud-minor-mode + (setq gud-minor-mode-type gud-minor-mode))) + +(add-hook 'kill-buffer-hook 'gud-kill-buffer-hook) + +(defun gud-reset () + (dolist (buffer (buffer-list)) + (if (not (eq buffer gud-comint-buffer)) + (save-excursion + (set-buffer buffer) + (when gud-minor-mode + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map)))))) + (defun gud-display-frame () "Find and obey the last filename-and-line marker from the debugger. Obeying it means displaying in another window the specified file and line."