diff options
| -rw-r--r-- | lisp/gud.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/gud.el b/lisp/gud.el index d8544e8d878..fac1ae15705 100644 --- a/lisp/gud.el +++ b/lisp/gud.el | |||
| @@ -809,14 +809,15 @@ comint mode, which see." | |||
| 809 | (setq w (cdr w))) | 809 | (setq w (cdr w))) |
| 810 | (car w))) | 810 | (car w))) |
| 811 | (args (delq file-word (cdr words))) | 811 | (args (delq file-word (cdr words))) |
| 812 | (file (expand-file-name (substitute-in-file-name file-word))) | 812 | (file (and file-word |
| 813 | (filepart (file-name-nondirectory file))) | 813 | (expand-file-name (substitute-in-file-name file-word)))) |
| 814 | (filepart (and file-word (file-name-nondirectory file)))) | ||
| 814 | (switch-to-buffer (concat "*gud-" filepart "*")) | 815 | (switch-to-buffer (concat "*gud-" filepart "*")) |
| 815 | (setq default-directory (file-name-directory file)) | 816 | (and file-word (setq default-directory (file-name-directory file))) |
| 816 | (or (bolp) (newline)) | 817 | (or (bolp) (newline)) |
| 817 | (insert "Current directory is " default-directory "\n") | 818 | (insert "Current directory is " default-directory "\n") |
| 818 | (apply 'make-comint (concat "gud-" filepart) program nil | 819 | (apply 'make-comint (concat "gud-" filepart) program nil |
| 819 | (gud-massage-args file args))) | 820 | (if file-word (gud-massage-args file args)))) |
| 820 | (gud-mode) | 821 | (gud-mode) |
| 821 | (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) | 822 | (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter) |
| 822 | (set-process-sentinel (get-buffer-process (current-buffer)) 'gud-sentinel) | 823 | (set-process-sentinel (get-buffer-process (current-buffer)) 'gud-sentinel) |