comparison lisp/gud.el @ 11930:d86841220451

(gud-common-init): Don't die if filename not supplied. Omit trailing hyphen when no filename follows.
author Karl Heuer <kwzh@gnu.org>
date Fri, 26 May 1995 04:14:08 +0000
parents b481316dd562
children 5d3f2639cf3a
comparison
equal deleted inserted replaced
11929:46487d19cdb3 11930:d86841220451
1116 ;; and put t in its place. 1116 ;; and put t in its place.
1117 ;; Later on we will put the modified file name arg back there. 1117 ;; Later on we will put the modified file name arg back there.
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))
1126 ;; If a directory was specified, expand the file name. 1127 ;; If a directory was specified, expand the file name.
1127 ;; Otherwise, don't expand it, so GDB can use the PATH. 1128 ;; Otherwise, don't expand it, so GDB can use the PATH.
1130 ;; omitting the expansion here has no visible effect. 1131 ;; omitting the expansion here has no visible effect.
1131 (file (and file-word 1132 (file (and file-word
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.
1140 ;; In that case, either the file is found in the current directory, 1141 ;; In that case, either the file is found in the current directory,
1141 ;; in which case this setq is a no-op, 1142 ;; in which case this setq is a no-op,
1147 (insert "Current directory is " default-directory "\n") 1148 (insert "Current directory is " default-directory "\n")
1148 ;; Put the substituted and expanded file name back in its place. 1149 ;; Put the substituted and expanded file name back in its place.
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)
1157 (make-local-variable 'gud-marker-filter) 1159 (make-local-variable 'gud-marker-filter)
1158 (setq gud-marker-filter marker-filter) 1160 (setq gud-marker-filter marker-filter)