emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem using call-process with grep


From: David Kastrup
Subject: Re: problem using call-process with grep
Date: Sat, 24 Dec 2005 00:20:09 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Drew Adams" <address@hidden> writes:

>     >  (call-process "grep" nil
>     >                (generate-new-buffer "Result")
>     >                nil "epsilon\\($\\)" "foo")
>     >
>     > This does *not* work for me.
>
>     I guess you want to call some echo-like program compiled in the same
>     way as your "grep" to see what actually is happening here.  Probably
>     some part of Cygwin's Unix emulation layer is trying variable
>     substitution or replacing backward with forward slashes or adding
>     quotes or something like that.
>
> Could you be more specific on what to try?

Use /bin/echo instead of grep.  Something like that.

> I also don't understand how this could be a Cygwin problem

Because Emacs might be compiled with Cygwin?  Because it might try to
interact with Cygwin?

> But you made me think of another possibility. Could it be that
> `call-process' somehow processes its arguments in such a way that it
> applies Windows-to-Unix directory-separator conversion to all of
> them, flipping backslashes to slashes?
>
> I don't think so. For instance, if I use this regexp, it works OK:
> "eps\\ilon$". If backslashes were changed to slashes, then this
> would not match "epsilon" in the file.
>
> Another regexp that doesn't work: "gamma\\(,\\)" - just to show that
> the problem is with \(...\), not with $ (variable substitution).

Well, maybe what arrives at the application level is gamma(,) without
backslashed at all.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]