RE: Using jde-ant build with default shell
"Borgman, Lennart" <[email protected]> Mon, 16 Apr 2007 13:19:58 +0200
| Newsgroups | gmane.emacs.jdee |
|---|---|
| Message-ID | <BEF12664CA5D8B4CA6F5E9B35A256C7228D558@SELURDEMBX01.rd.astrazeneca.net> |
> -----Original Message----- > From: Jere McDevitt [mailto:[email protected]] > Sent: 16 april 2007 03:16 > Normally I use ntemacs and jdee with the Cygwin tools > installed, but due to > some restrictions in a particular situation, I can use > ntemacs & jdee but > not cygwin. When doing an ant build (C-c C-v C-b), the build > would fail > with: > > cd k:/devel/projects/client/src/client/ > ant -buildfile 'k:/devel/projects/client/build.xml' -emacs test > Buildfile: 'k:\devel\projects\client\build.xml' does not exist! > Build failed > > even though that is the correct build file. It turns out the > default shell > for emacs (emacs/bin/cmdproxy.exe which is the Windows > cmd.exe shell) does > not like the single quote marks that are surrounding the > build file name. > To work around this, I made the following modifications to jde-ant.el ... > This changes the single quotes (') to double quotes (") if > the shell is > cmdproxy, regardless of the invocation method. It may fail > when using the > ant server, but I don't use that so I'm not sure. > > I'm an elisp novice, but this seems to work both when I have > a cygwin bash > shell in use or the default Window's shell. If there is a > better way to > make this work I'd appreciate seeing it so I don't have to > have a modified > version of the lisp files. There is an elisp function `shell-quote-argument' for handling this. That function should be called immediately before sending the arguments to the shell so that the correct shell-file-name is used when trying to decide the quoting style. So this is a bug in jde-ant.el.