summaryrefslogtreecommitdiff
path: root/lisp/gud.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-05-26 04:14:08 +0000
committerKarl Heuer <kwzh@gnu.org>1995-05-26 04:14:08 +0000
commit97c7c8132492091103f218b2540c94790ff68c77 (patch)
treeb468d4d6c045161ff6cf25ba40e698d78961a8eb /lisp/gud.el
parentcfad3c5b4fdfe8e886a050de7f95d6b301df7a59 (diff)
downloademacs-97c7c8132492091103f218b2540c94790ff68c77.tar.gz
(gud-common-init): Don't die if filename not supplied.
Omit trailing hyphen when no filename follows.
Diffstat (limited to 'lisp/gud.el')
-rw-r--r--lisp/gud.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index 859c0e0bd40..75f56b90d45 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -1118,8 +1118,9 @@ comint mode, which see."
(file-word (let ((w (cdr words)))
(while (and w (= ?- (aref (car w) 0)))
(setq w (cdr w)))
- (prog1 (car w)
- (setcar w t))))
+ (and w
+ (prog1 (car w)
+ (setcar w t)))))
(file-subst
(and file-word (substitute-in-file-name file-word)))
(args (cdr words))
@@ -1132,8 +1133,8 @@ comint mode, which see."
(if (file-name-directory file-subst)
(expand-file-name file-subst)
file-subst)))
- (filepart (and file-word (file-name-nondirectory file))))
- (switch-to-buffer (concat "*gud-" filepart "*"))
+ (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
+ (switch-to-buffer (concat "*gud" filepart "*"))
;; Set default-directory to the file's directory.
(and file-word
;; Don't set default-directory if no directory was specified.
@@ -1149,8 +1150,9 @@ comint mode, which see."
(let ((w args))
(while (and w (not (eq (car w) t)))
(setq w (cdr w)))
- (setcar w file))
- (apply 'make-comint (concat "gud-" filepart) program nil
+ (if w
+ (setcar w file)))
+ (apply 'make-comint (concat "gud" filepart) program nil
(if file-word (funcall massage-args file args) args)))
;; Since comint clobbered the mode, we don't set it until now.
(gud-mode)