From: Nick Roberts Date: Wed, 28 Apr 2004 18:15:12 +0000 (+0000) Subject: (gud-common-init): Throw an error if program is X-Git-Tag: ttn-vms-21-2-B4~6535 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ab26292ec194a6866b6b06509510ff80587a5ca;p=emacs.git (gud-common-init): Throw an error if program is already running under gdb. --- 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.