From 5ab26292ec194a6866b6b06509510ff80587a5ca Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Wed, 28 Apr 2004 18:15:12 +0000 Subject: [PATCH] (gud-common-init): Throw an error if program is already running under gdb. --- lisp/progmodes/gud.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index bdf8c93f900..9cb3ae26c3b 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2384,8 +2384,10 @@ comint mode, which see." (if (file-name-directory file-subst) (expand-file-name file-subst) file-subst))) - (filepart (and file-word (concat "-" (file-name-nondirectory file))))) + (filepart (and file-word (concat "-" (file-name-nondirectory file)))) + (existing-buffer (get-buffer (concat "*gud" filepart "*")))) (pop-to-buffer (concat "*gud" filepart "*")) + (if existing-buffer (error "This program is already running under gdb")) ;; Set the dir, in case the buffer already existed with a different dir. (setq default-directory dir) ;; Set default-directory to the file's directory. -- 2.39.5