Here is my result for your reference: *E:\tmp>ls* *2 2.c echocmd.c echocmd.exe hello.c hello.o* * * *E:\tmp>echocmd "*find*"* *`echocmd "*find*"'* *0: `echocmd'* *1: `*find*'* * * *E:\tmp>echocmd *.c* *`echocmd *.c'* *0: `echocmd'* *1: `2.c'* *2: `echocmd.c'* *3: `hello.c'* * * *E:\tmp>echocmd "*.c"* *`echocmd "*.c"'* *0: `echocmd'* *1: `2.c'* *2: `echocmd.c'* *3: `hello.c'* * * *E:\tmp>* * * I think quote is not the main problem. The find.exe in your port only works when "*" is on left side of name: * * * E:\tmp>find . -name "*cmd*" find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression]
E:\tmp>find . -name *cmd* find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] E:\tmp>find . -name *cmd.c ./echocmd.c E:\tmp>find . -name echo* find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] E:\tmp>find . -name "*cmd.c" ./echocmd.c E:\tmp>find . -name "echo*" find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] E:\tmp> * * * On Sat, Jan 28, 2012 at 8:04 PM, Eli Zaretskii <e...@gnu.org> wrote: > > From: Juanma Barranquero <lek...@gmail.com> > > Date: Sat, 28 Jan 2012 12:29:23 +0100 > > Cc: sthfrnth <sthfr...@gmail.com>, help-emacs-windows@gnu.org > > > > I'm also on W7 (64-bit, like the OP), and I see the problem, too. > > You mean, the find.exe from my port doesn't work with quoted > wildcards? > > > > emacs -Q -batch --eval "(princ (directory-files \".\" nil > \"?*\\.c\\'\"))" > > > > > > If quoted arguments work "as I'd expect" (i.e. quotes are removed, > > > unless escaped by a backslash, in which case the backslash is removed > > > and the quote stays), then this command should display the list of all > > > *.c files in the directory where you invoke this command. > > > > It displays the list of .c files, as expected: > > Then something was wrong with my reasoning... Hm... > > If you compile the simple program below, and then type > > echocmd "*find*" > > what do you see? And what do you see if you type > > echocmd *.c > > and > > echocmd "*.c" > > in a directory with C files? > > --------------------------- echocmd.c ----------------------- > #include <stdio.h> > #include <windows.h> > > int main (int argc, char *argv[]) > { > int i = 0; > > printf ("`%s'\n", GetCommandLine ()); > while (argc--) > printf ("%d: `%s'\n", i++, *(argv++)); > return 0; > } > ----------------------------------------------------------------- > > > > >