changeset 55558:0ac980237ad3

(gud-mode): Add gud-kill-buffer-hook to kill-buffer-hook here and make it local. (gud-kill-buffer-hook): Use kill-process for a sure kill.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 12 May 2004 20:43:47 +0000
parents 2230abc1601e
children a4d697f046db
files lisp/progmodes/gud.el
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Wed May 12 20:42:07 2004 +0000
+++ b/lisp/progmodes/gud.el	Wed May 12 20:43:47 2004 +0000
@@ -2339,7 +2339,8 @@
   ;; Don't put repeated commands in command history many times.
   (set (make-local-variable 'comint-input-ignoredups) t)
   (make-local-variable 'paragraph-start)
-  (set (make-local-variable 'gud-delete-prompt-marker) (make-marker)))
+  (set (make-local-variable 'gud-delete-prompt-marker) (make-marker))
+  (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t))
 
 ;; Cause our buffers to be displayed, by default,
 ;; in the selected window.
@@ -2546,10 +2547,10 @@
 	     (set-buffer obuf))))))
 
 (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)
+  (setq gud-minor-mode-type gud-minor-mode)
+  (condition-case nil
+      (kill-process (get-buffer-process gud-comint-buffer))
+    (error nil)))
 
 (defun gud-reset ()
   (dolist (buffer (buffer-list))