[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Space in compiler file name
From: |
Kevin Rodgers |
Subject: |
Re: Space in compiler file name |
Date: |
Thu, 23 Feb 2006 11:15:47 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
Brian Elmegaard wrote:
Eli Zaretskii <eliz@gnu.org> writes:
The one with ".." should have worked. Please show the full
customization command that uses double quotes, perhaps something was
wrong in how you escaped quotes within a string.
Thanks, Eli, you found my mistake.
The problem is that I concatenate the directory path in double quotes
and the file name to get:
"c:/program files/dna/bin"/dna.exe
which obviously doesnøt work.
Is there a neat way to append inside the quotes?
Since the directory name itself does not have quotes, I think the right
thing to do is to add the quotes when you generate the shell command,
which is what requires them:
(setq dna-bin-directory "c:/program files/dna/bin")
(setq compile-command
(format "\"%s\" %s"
(expand-file-name dna-executable-name dna-bin-directory)
(file-name-nondirectory buffer-file-name)))
Or perhaps (1) make compile-command a buffer local variable, since its
value is specific to the buffer and (2) use the shell-quote-argument
utility to handle both the program and the file:
(set (make-local-variable 'compile-command)
(concat (shell-quote-argument
(expand-file-name dna-executable-name dna-bin-directory))
" "
(shell-quote-argument
(expand-file-name (file-name-nondirectory
buffer-file-name)))))
Is it correct that emacs outputs:
'c:/program' is not recognized as an internal or external command,
operable program or batch file.
when this error is encountered?
That looks like a message from your shell, not Emacs.
--
Kevin Rodgers