* Space in compiler file name
@ 2006-02-20 7:55 Brian Elmegaard
2006-02-20 21:00 ` Eli Zaretskii
[not found] ` <mailman.961.1140469246.2856.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 14+ messages in thread
From: Brian Elmegaard @ 2006-02-20 7:55 UTC (permalink / raw)
Hi,
On windows I have a compiler installed under c:\Program
Files\dna\bin. This path is set to dna.bin-directory with customize
for the given mode.
When I run I get:
c:/program files/dna/bin/dna.exe
'c:/program' is not recognized as an internal or external command,
operable program or batch file.
The compile command is set by:
(setq compile-command
(progn (concat dna-bin-directory "/"
dna-executable-name " "
(file-name-nondirectory
buffer-file-name))))
(setq dna-input-buffer-name (buffer-name))
(compile compile-command)
How can I make dna-bin-directory contain spaces and pass this to
compile?
tia,
--
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Space in compiler file name
2006-02-20 7:55 Space in compiler file name Brian Elmegaard
@ 2006-02-20 21:00 ` Eli Zaretskii
[not found] ` <mailman.961.1140469246.2856.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2006-02-20 21:00 UTC (permalink / raw)
> From: Brian Elmegaard <brian@rkspeed-rugby.dk>
> Date: Mon, 20 Feb 2006 08:55:35 +0100
>
> When I run I get:
> c:/program files/dna/bin/dna.exe
> 'c:/program' is not recognized as an internal or external command,
> operable program or batch file.
>
> The compile command is set by:
> (setq compile-command
> (progn (concat dna-bin-directory "/"
> dna-executable-name " "
> (file-name-nondirectory
> buffer-file-name))))
> (setq dna-input-buffer-name (buffer-name))
> (compile compile-command)
>
>
> How can I make dna-bin-directory contain spaces and pass this to
> compile?
Did you try to quote the file name which has the embedded spaces?
compile-command is conceptually a string that you would type at the
shell's prompt, so you need to quote or escape any characters special
for the shell, as you would when you type the command interactively.
^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.961.1140469246.2856.help-gnu-emacs@gnu.org>]
* Re: Space in compiler file name
[not found] ` <mailman.961.1140469246.2856.help-gnu-emacs@gnu.org>
@ 2006-02-20 21:42 ` Brian Elmegaard
2006-02-21 12:21 ` Reiner Steib
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Brian Elmegaard @ 2006-02-20 21:42 UTC (permalink / raw)
Eli Zaretskii <eliz@gnu.org> writes:
> Did you try to quote the file name which has the embedded spaces?
Yes, I have tried:
c:/program files/dna/bin/dna.exe
'c:/program files/dna/bin/dna.exe'
"c:/program files/dna/bin/dna.exe"
c:/program\ files/dna/bin/dna.exe
> compile-command is conceptually a string that you would type at the
> shell's prompt, so you need to quote or escape any characters special
> for the shell, as you would when you type the command interactively.
I can do it in the windows shell. So emacs somehow interferes when it
passes this to the shell.
How could I escape or quote a space in a shell command?
tia,
--
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Space in compiler file name
2006-02-20 21:42 ` Brian Elmegaard
@ 2006-02-21 12:21 ` Reiner Steib
2006-02-21 19:51 ` Eli Zaretskii
` (2 subsequent siblings)
3 siblings, 0 replies; 14+ messages in thread
From: Reiner Steib @ 2006-02-21 12:21 UTC (permalink / raw)
On Mon, Feb 20 2006, Brian Elmegaard wrote:
> Yes, I have tried:
> c:/program files/dna/bin/dna.exe
> 'c:/program files/dna/bin/dna.exe'
> "c:/program files/dna/bin/dna.exe"
> c:/program\ files/dna/bin/dna.exe
How about the DOS name trick? "c:/progra~1/dna/bin/dna.exe"? AFAIK,
the "dir" command lists the sort 8.3 names.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Space in compiler file name
2006-02-20 21:42 ` Brian Elmegaard
2006-02-21 12:21 ` Reiner Steib
@ 2006-02-21 19:51 ` Eli Zaretskii
[not found] ` <mailman.1066.1140542049.2856.help-gnu-emacs@gnu.org>
[not found] ` <mailman.1116.1140553083.2856.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2006-02-21 19:51 UTC (permalink / raw)
> From: Brian Elmegaard <brian@rkspeed-rugby.dk>
> Date: Mon, 20 Feb 2006 22:42:56 +0100
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Did you try to quote the file name which has the embedded spaces?
>
> Yes, I have tried:
> c:/program files/dna/bin/dna.exe
> 'c:/program files/dna/bin/dna.exe'
> "c:/program files/dna/bin/dna.exe"
> c:/program\ files/dna/bin/dna.exe
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.
Also, do you have some port of a Unix shell (sh.exe) installed? If
so, is it by any chance a Cygwin port?
> I can do it in the windows shell. So emacs somehow interferes when it
> passes this to the shell.
Does it work to invoke that compiler via "M-!" (again, with quoting as
if you were typing at the shell's prompt)?
> How could I escape or quote a space in a shell command?
With double quotes. Except for bugs or cockpit errors, it should have
worked.
^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.1066.1140542049.2856.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.1116.1140553083.2856.help-gnu-emacs@gnu.org>]
* Re: Space in compiler file name
[not found] ` <mailman.1116.1140553083.2856.help-gnu-emacs@gnu.org>
@ 2006-02-22 15:14 ` Brian Elmegaard
2006-02-23 18:15 ` Kevin Rodgers
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Brian Elmegaard @ 2006-02-22 15:14 UTC (permalink / raw)
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?
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?
> Except for bugs or cockpit errors, it should have worked.
:-)
--
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Space in compiler file name
2006-02-22 15:14 ` Brian Elmegaard
@ 2006-02-23 18:15 ` Kevin Rodgers
2006-02-24 7:28 ` Eli Zaretskii
` (2 subsequent siblings)
3 siblings, 0 replies; 14+ messages in thread
From: Kevin Rodgers @ 2006-02-23 18:15 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Space in compiler file name
2006-02-22 15:14 ` Brian Elmegaard
2006-02-23 18:15 ` Kevin Rodgers
@ 2006-02-24 7:28 ` Eli Zaretskii
[not found] ` <mailman.19.1140819603.5016.help-gnu-emacs@gnu.org>
[not found] ` <mailman.41.1140852357.5016.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2006-02-24 7:28 UTC (permalink / raw)
> From: Brian Elmegaard <brian@rkspeed-rugby.dk>
> Date: Wed, 22 Feb 2006 16:14:25 +0100
>
> Is there a neat way to append inside the quotes?
(concat "\"" diectory file "\"")
> 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?
This message comes from cmd.exe, the Windows shell, not from Emacs.
Emacs just shows you what the shell displayed, so you know what went
wrong.
^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.19.1140819603.5016.help-gnu-emacs@gnu.org>]
[parent not found: <mailman.41.1140852357.5016.help-gnu-emacs@gnu.org>]
* RE: Space in compiler file name
@ 2006-02-21 5:30 Dave Humphries
2006-02-21 19:52 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Dave Humphries @ 2006-02-21 5:30 UTC (permalink / raw)
Have you tried with back slashes (maybe even double back slashes) and
quotes?
-----Original Message-----
From: help-gnu-emacs-bounces+dave.humphries=dytech.com.au@gnu.org
[mailto:help-gnu-emacs-bounces+dave.humphries=dytech.com.au@gnu.org] On
Behalf Of Brian Elmegaard
Sent: Tuesday, 21 February 2006 8:43 AM
To: help-gnu-emacs@gnu.org
Subject: Re: Space in compiler file name
Eli Zaretskii <eliz@gnu.org> writes:
> Did you try to quote the file name which has the embedded spaces?
Yes, I have tried:
c:/program files/dna/bin/dna.exe
'c:/program files/dna/bin/dna.exe'
"c:/program files/dna/bin/dna.exe"
c:/program\ files/dna/bin/dna.exe
> compile-command is conceptually a string that you would type at the
> shell's prompt, so you need to quote or escape any characters special
> for the shell, as you would when you type the command interactively.
I can do it in the windows shell. So emacs somehow interferes when it
passes this to the shell.
How could I escape or quote a space in a shell command?
tia,
--
Brian (remove the sport for mail)
http://www.et.web.mek.dtu.dk/Staff/be/be.html
http://www.rugbyklubben-speed.dk
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.1012.1140499926.2856.help-gnu-emacs@gnu.org>]
end of thread, other threads:[~2006-02-25 8:45 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 7:55 Space in compiler file name Brian Elmegaard
2006-02-20 21:00 ` Eli Zaretskii
[not found] ` <mailman.961.1140469246.2856.help-gnu-emacs@gnu.org>
2006-02-20 21:42 ` Brian Elmegaard
2006-02-21 12:21 ` Reiner Steib
2006-02-21 19:51 ` Eli Zaretskii
[not found] ` <mailman.1066.1140542049.2856.help-gnu-emacs@gnu.org>
2006-02-22 7:19 ` Brian Elmegaard
[not found] ` <mailman.1116.1140553083.2856.help-gnu-emacs@gnu.org>
2006-02-22 15:14 ` Brian Elmegaard
2006-02-23 18:15 ` Kevin Rodgers
2006-02-24 7:28 ` Eli Zaretskii
[not found] ` <mailman.19.1140819603.5016.help-gnu-emacs@gnu.org>
2006-02-25 8:45 ` Brian Elmegaard
[not found] ` <mailman.41.1140852357.5016.help-gnu-emacs@gnu.org>
2006-02-25 8:45 ` Brian Elmegaard
-- strict thread matches above, loose matches on Subject: below --
2006-02-21 5:30 Dave Humphries
2006-02-21 19:52 ` Eli Zaretskii
[not found] <mailman.1012.1140499926.2856.help-gnu-emacs@gnu.org>
2006-02-21 9:40 ` Brian Elmegaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).