all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: problem using call-process with grep
Date: Sat, 24 Dec 2005 00:20:09 +0100	[thread overview]
Message-ID: <85vexfmmdy.fsf@lola.goethe.zz> (raw)
In-Reply-To: <DNEMKBNJBGPAOPIJOOICKELFDAAA.drew.adams@oracle.com> (Drew Adams's message of "Fri, 23 Dec 2005 15:16:44 -0800")

"Drew Adams" <drew.adams@oracle.com> 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	other threads:[~2005-12-23 23:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-22 18:05 Q on call-process and grep Drew Adams
2005-12-23  6:45 ` problem using call-process with grep Drew Adams
2005-12-23 18:11   ` Richard M. Stallman
2005-12-23 18:24     ` Drew Adams
2005-12-23 22:02       ` Kevin Rodgers
2005-12-23 22:18         ` Drew Adams
2005-12-23 22:42           ` David Kastrup
2005-12-23 23:16             ` Drew Adams
2005-12-23 23:20               ` David Kastrup [this message]
2005-12-23 23:44                 ` Drew Adams
2005-12-23 23:52                   ` David Kastrup
2005-12-24  0:42                     ` Drew Adams
2005-12-24  4:48                       ` Giorgos Keramidas
2005-12-24 16:32       ` Richard M. Stallman
2005-12-24 16:35         ` Drew Adams
2005-12-24 16:57           ` Eli Zaretskii
2005-12-24 17:08             ` Drew Adams
2005-12-24 17:35               ` Eli Zaretskii
     [not found] <jku0cz1e9l.fsf@glug.org>
2005-12-24  1:51 ` Drew Adams
2005-12-24 11:56   ` Eli Zaretskii
2005-12-24 15:48     ` Drew Adams
2005-12-24 16:36       ` Eli Zaretskii
2005-12-24 16:39         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85vexfmmdy.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.