Mercurial > emacs
comparison lisp/gud.el @ 5508:67db1f804162
(gud-common-init): Don't crash if no file specified.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 08 Jan 1994 12:18:55 +0000 |
parents | a60a8979d34b |
children | 6187a2560211 |
comparison
equal
deleted
inserted
replaced
5507:0a6c0e720ece | 5508:67db1f804162 |
---|---|
807 (file-word (let ((w (cdr words))) | 807 (file-word (let ((w (cdr words))) |
808 (while (and w (= ?- (aref (car w) 0))) | 808 (while (and w (= ?- (aref (car w) 0))) |
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) |
823 (gud-set-buffer) | 824 (gud-set-buffer) |
824 ) | 825 ) |