mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-05 15:11:30 -08:00
(gud-common-init): Don't crash if no file specified.
This commit is contained in:
parent
84fa8eb54b
commit
52b85866af
1 changed files with 5 additions and 4 deletions
|
|
@ -809,14 +809,15 @@ comint mode, which see."
|
|||
(setq w (cdr w)))
|
||||
(car w)))
|
||||
(args (delq file-word (cdr words)))
|
||||
(file (expand-file-name (substitute-in-file-name file-word)))
|
||||
(filepart (file-name-nondirectory file)))
|
||||
(file (and file-word
|
||||
(expand-file-name (substitute-in-file-name file-word))))
|
||||
(filepart (and file-word (file-name-nondirectory file))))
|
||||
(switch-to-buffer (concat "*gud-" filepart "*"))
|
||||
(setq default-directory (file-name-directory file))
|
||||
(and file-word (setq default-directory (file-name-directory file)))
|
||||
(or (bolp) (newline))
|
||||
(insert "Current directory is " default-directory "\n")
|
||||
(apply 'make-comint (concat "gud-" filepart) program nil
|
||||
(gud-massage-args file args)))
|
||||
(if file-word (gud-massage-args file args))))
|
||||
(gud-mode)
|
||||
(set-process-filter (get-buffer-process (current-buffer)) 'gud-filter)
|
||||
(set-process-sentinel (get-buffer-process (current-buffer)) 'gud-sentinel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue