aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1995-05-26 04:14:08 +0000
committerKarl Heuer1995-05-26 04:14:08 +0000
commitc27c10423eb9a791af5ee86b2ab0ff68ee077085 (patch)
tree7f32414073d8a353826efe91c7cb77a0dffb3764
parent2db10f13d9d2d2f3bf4255e70f24722b98203ed0 (diff)
downloademacs-c27c10423eb9a791af5ee86b2ab0ff68ee077085.tar.gz
emacs-c27c10423eb9a791af5ee86b2ab0ff68ee077085.zip
(gud-common-init): Don't die if filename not supplied.
Omit trailing hyphen when no filename follows.
-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."
1118 (file-word (let ((w (cdr words))) 1118 (file-word (let ((w (cdr words)))
1119 (while (and w (= ?- (aref (car w) 0))) 1119 (while (and w (= ?- (aref (car w) 0)))
1120 (setq w (cdr w))) 1120 (setq w (cdr w)))
1121 (prog1 (car w) 1121 (and w
1122 (setcar w t)))) 1122 (prog1 (car w)
1123 (setcar w t)))))
1123 (file-subst 1124 (file-subst
1124 (and file-word (substitute-in-file-name file-word))) 1125 (and file-word (substitute-in-file-name file-word)))
1125 (args (cdr words)) 1126 (args (cdr words))
@@ -1132,8 +1133,8 @@ comint mode, which see."
1132 (if (file-name-directory file-subst) 1133 (if (file-name-directory file-subst)
1133 (expand-file-name file-subst) 1134 (expand-file-name file-subst)
1134 file-subst))) 1135 file-subst)))
1135 (filepart (and file-word (file-name-nondirectory file)))) 1136 (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
1136 (switch-to-buffer (concat "*gud-" filepart "*")) 1137 (switch-to-buffer (concat "*gud" filepart "*"))
1137 ;; Set default-directory to the file's directory. 1138 ;; Set default-directory to the file's directory.
1138 (and file-word 1139 (and file-word
1139 ;; Don't set default-directory if no directory was specified. 1140 ;; Don't set default-directory if no directory was specified.
@@ -1149,8 +1150,9 @@ comint mode, which see."
1149 (let ((w args)) 1150 (let ((w args))
1150 (while (and w (not (eq (car w) t))) 1151 (while (and w (not (eq (car w) t)))
1151 (setq w (cdr w))) 1152 (setq w (cdr w)))
1152 (setcar w file)) 1153 (if w
1153 (apply 'make-comint (concat "gud-" filepart) program nil 1154 (setcar w file)))
1155 (apply 'make-comint (concat "gud" filepart) program nil
1154 (if file-word (funcall massage-args file args) args))) 1156 (if file-word (funcall massage-args file args) args)))
1155 ;; Since comint clobbered the mode, we don't set it until now. 1157 ;; Since comint clobbered the mode, we don't set it until now.
1156 (gud-mode) 1158 (gud-mode)