Subject: 23.0.90; ! in Dired does not shell-quote the command name and args

From: "Drew Adams" <[email-masked]>
Date: Sun, 1 Mar 2009 21:36:18 -0800

emacs -Q
 
load library cygwin-mount.el, then setup-cygwin.el:
 
http://www.emacswiki.org/emacs/cygwin-mount.el
http://www.emacswiki.org/emacs/setup-cygwin.el
 
Use /bin/bash.exe as SHELL.
 
Hit `!' on some file.
 
Type the absolute name of an executable file, which name contains a
space. For example: c:/Program Files/Adobe/FrameMaker7.2/FrameMaker.exe.
 
You get an error: /usr/bin/bash: c:/Program: No such file or directory
 
The problem is that the command and its args are not being
shell-quoted, so the file name is truncated at the first space (after
`Program').  The same problem exists for `&' as for `!'.
 
I'm not sure the solution would be as simple as just applying
`shell-quote' to whatever text is entered, since the command is also
supposed to accept some wildcard characters, such as `*'.  (I didn't
check the code - just guessing.)
 
But some fix must be found. Otherwise, `!' and `&' are less than
useful on platforms such as Windows that typically use spaces in file
and directory names.
 
This problem exists in Emacs 22 also. There, there are even more
wildcards to deal with, since `&' is a wildcard for `!'.  For example,
to run `foo' asynchronously, you can enter `foo * &'.

In GNU Emacs 23.0.90.1 (i386-mingw-nt5.1.2600)
 of 2009-02-01 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'