all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Warning to those using rgrep on Mac OS X
@ 2012-12-17 18:03 Perry Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Perry Smith @ 2012-12-17 18:03 UTC (permalink / raw)
  To: Emacs help

I'm using Mac OS 10.7.5 and emacs 24.1.1

Over the weekend I discovered that the command line that rgrep produces does not work.  This is not an emacs issue... I'm just trying to warn people.

I was not able to 100% characterize it but it appears that if the matches are for files very far down the directory structure, *sometimes* the command will just return immediately.  I was matching create_view_specs and the file that should have matched was at 

.bundle/gems/ruby/1.9.1/gems/rspec-rails-2.12.0/lib/generators/rspec/view/view_generator.rb

If I started at the file's directory, it matched.  If I moved up one or two directories, it matched.  If I moved up three directories, it would match but the string produced was not what the emacs pattern was looking for.  If I moved up four directories, the command would just immediately return.  Doing the same from the command line had the same results so its not an emacs bug.

The command is producing the -exec grep ..... +  version. grep-find-use-xargs is set to exec-plus

There is no simple way to get setting grep-find-use-xargs to 'gnu to work because out of the box, emacs adds in -e to xargs (which is non-standard and the Mac doesn't have it).  I don't really get what the -e with no string is trying to do.  I'm also slightly puzzled why the grep-probe didn't try other argument patterns... I can't say I 100% understand the code.

If I hand edit the command using -print0 | xargs -0, it does match and then emacs doesn't recognize the string grep issues.

Perry




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
       [not found] <mailman.15544.1355767438.855.help-gnu-emacs@gnu.org>
@ 2012-12-18  9:28 ` Aidan Gauland
  2012-12-18 10:27   ` Thierry Volpiatto
  0 siblings, 1 reply; 12+ messages in thread
From: Aidan Gauland @ 2012-12-18  9:28 UTC (permalink / raw)
  To: help-gnu-emacs

Perry Smith <pedzsan@gmail.com> writes:
> There is no simple way to get setting grep-find-use-xargs to 'gnu to
> work because out of the box, emacs adds in -e to xargs (which is
> non-standard and the Mac doesn't have it).

According to the GNU grep manual, "`-e' is specified by POSIX," so grep
on any POSIX system — which, as far as I know, Macintosh is — should
have it.  So why the heck does Macintosh's grep (would we call it
"Darwin grep?") command not have it?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18  9:28 ` Warning to those using rgrep on Mac OS X Aidan Gauland
@ 2012-12-18 10:27   ` Thierry Volpiatto
  2012-12-18 17:34     ` Eli Zaretskii
       [not found]     ` <mailman.15621.1355852062.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Thierry Volpiatto @ 2012-12-18 10:27 UTC (permalink / raw)
  To: help-gnu-emacs

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:

> Perry Smith <pedzsan@gmail.com> writes:
>> There is no simple way to get setting grep-find-use-xargs to 'gnu to
>> work because out of the box, emacs adds in -e to xargs (which is
>> non-standard and the Mac doesn't have it).
>
> According to the GNU grep manual, "`-e' is specified by POSIX," so grep
> on any POSIX system — which, as far as I know, Macintosh is — should
> have it.  So why the heck does Macintosh's grep (would we call it
> "Darwin grep?") command not have it?
>
Emacs for rgrep use, in addition of grep, two more commands that are find
and xargs, which is not useful because grep itself is able to recurse
without the need of these commands.
It is not a problem on GNU/Linux system based, but seems to add
portability problems on other systems.

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18 10:27   ` Thierry Volpiatto
@ 2012-12-18 17:34     ` Eli Zaretskii
  2012-12-18 18:07       ` Thierry Volpiatto
       [not found]     ` <mailman.15621.1355852062.855.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-18 17:34 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
> Date: Tue, 18 Dec 2012 11:27:17 +0100
> 
> Emacs for rgrep use, in addition of grep, two more commands that are find
> and xargs, which is not useful because grep itself is able to recurse
> without the need of these commands.
> It is not a problem on GNU/Linux system based, but seems to add
> portability problems on other systems.

Not exactly due to portability problems, but due to the fact that
there are so many broken ports of 'find' and 'xargs', at least for
Windows, out there.  Using "grep -R" would indeed be better.  (Btw, on
GNU/Linux "grep -R" is _slower_ that "find | xargs grep" pipe.  But on
Windows, "grep -R" is faster, even with my "improved" and fast port of
GNU Find.)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18 17:34     ` Eli Zaretskii
@ 2012-12-18 18:07       ` Thierry Volpiatto
  2012-12-18 19:13         ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Thierry Volpiatto @ 2012-12-18 18:07 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>> Date: Tue, 18 Dec 2012 11:27:17 +0100
>> 
>> Emacs for rgrep use, in addition of grep, two more commands that are find
>> and xargs, which is not useful because grep itself is able to recurse
>> without the need of these commands.
>> It is not a problem on GNU/Linux system based, but seems to add
>> portability problems on other systems.
>
> Not exactly due to portability problems, but due to the fact that
> there are so many broken ports of 'find' and 'xargs', at least for
> Windows, out there.
I always heard (from you :-)) a patched version is needed on windows,
which is inconvenient for most users.


> Using "grep -R" would indeed be better.  (Btw, on GNU/Linux "grep -R"
> is _slower_ that "find | xargs grep" pipe.  But on Windows, "grep -R"
> is faster, even with my "improved" and fast port of GNU Find.)
I am using with emacs-helm "grep -R" since two years now and more
recently "ack-grep" with success on GNU/Linux.
I don't know how fast is find/xargs but using "grep -R" is already fast
enough for most of the tasks.
Using "ack-grep" is always faster than grep even if in theory it is slower than
grep (It do not parse uninteresting files/dirs by default).
 

-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18 18:07       ` Thierry Volpiatto
@ 2012-12-18 19:13         ` Eli Zaretskii
  2012-12-18 19:33           ` Thierry Volpiatto
  0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-18 19:13 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
> Date: Tue, 18 Dec 2012 19:07:51 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
> >> Date: Tue, 18 Dec 2012 11:27:17 +0100
> >> 
> >> Emacs for rgrep use, in addition of grep, two more commands that are find
> >> and xargs, which is not useful because grep itself is able to recurse
> >> without the need of these commands.
> >> It is not a problem on GNU/Linux system based, but seems to add
> >> portability problems on other systems.
> >
> > Not exactly due to portability problems, but due to the fact that
> > there are so many broken ports of 'find' and 'xargs', at least for
> > Windows, out there.
> I always heard (from you :-)) a patched version is needed on windows,

What do you mean by "patched version"?  GNU Find without patches will
simply not compile on Windows.

> which is inconvenient for most users.

??? My port is available for download:

  http://sourceforge.net/projects/ezwinports/files/findutils-4.2.30-4-w32-bin.zip/download

(There's a 64-bit build there, too, courtesy of another user.)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18 19:13         ` Eli Zaretskii
@ 2012-12-18 19:33           ` Thierry Volpiatto
  2012-12-18 20:04             ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Thierry Volpiatto @ 2012-12-18 19:33 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>> Date: Tue, 18 Dec 2012 19:07:51 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
>> >> Date: Tue, 18 Dec 2012 11:27:17 +0100
>> >> 
>> >> Emacs for rgrep use, in addition of grep, two more commands that are find
>> >> and xargs, which is not useful because grep itself is able to recurse
>> >> without the need of these commands.
>> >> It is not a problem on GNU/Linux system based, but seems to add
>> >> portability problems on other systems.
>> >
>> > Not exactly due to portability problems, but due to the fact that
>> > there are so many broken ports of 'find' and 'xargs', at least for
>> > Windows, out there.
>> I always heard (from you :-)) a patched version is needed on windows,
>
> What do you mean by "patched version"?  GNU Find without patches will
> simply not compile on Windows.
Ok, never try to install findutils on windows.

>> which is inconvenient for most users.
>
> ??? My port is available for download:
>
>   http://sourceforge.net/projects/ezwinports/files/findutils-4.2.30-4-w32-bin.zip/download
>
> (There's a 64-bit build there, too, courtesy of another user.)
>
Why don't you merge your port with gnu32 one's? And while you are at it
your updatedb too.


-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-18 19:33           ` Thierry Volpiatto
@ 2012-12-18 20:04             ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-18 20:04 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
> Date: Tue, 18 Dec 2012 20:33:10 +0100
> 
> >   http://sourceforge.net/projects/ezwinports/files/findutils-4.2.30-4-w32-bin.zip/download
> >
> > (There's a 64-bit build there, too, courtesy of another user.)
> >
> Why don't you merge your port with gnu32 one's?

Because GnuWin32 is dead.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
       [not found]     ` <mailman.15621.1355852062.855.help-gnu-emacs@gnu.org>
@ 2012-12-19  8:44       ` Vagn Johansen
  2012-12-19 15:35         ` Eli Zaretskii
       [not found]         ` <mailman.15671.1355931355.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Vagn Johansen @ 2012-12-19  8:44 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> Not exactly due to portability problems, but due to the fact that
> there are so many broken ports of 'find' and 'xargs', at least for
> Windows, out there.  

Why not use findstr on Windows then?

-- 
Vagn Johansen


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-19  8:44       ` Vagn Johansen
@ 2012-12-19 15:35         ` Eli Zaretskii
       [not found]         ` <mailman.15671.1355931355.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-19 15:35 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Vagn Johansen <gonz808@hotmail.com>
> Date: Wed, 19 Dec 2012 09:44:46 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Not exactly due to portability problems, but due to the fact that
> > there are so many broken ports of 'find' and 'xargs', at least for
> > Windows, out there.  
> 
> Why not use findstr on Windows then?

If you mean by default, then the reason is that findstr is very weak
and incompatible (or non-existent) on older versions of Windows.  One
can customize Emacs to use it, of course.

(My personal reason for not using findstr is that I don't want to
learn yet another tool with yet another set of incompatible options.
But that's me.)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
       [not found]         ` <mailman.15671.1355931355.855.help-gnu-emacs@gnu.org>
@ 2012-12-20  9:57           ` Vagn Johansen
  2012-12-20 16:20             ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: Vagn Johansen @ 2012-12-20  9:57 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> > Not exactly due to portability problems, but due to the fact that
>> > there are so many broken ports of 'find' and 'xargs', at least for
>> > Windows, out there.  
>> 
>> Why not use findstr on Windows then?
>
> If you mean by default, then the reason is that findstr is very weak
> and incompatible (or non-existent) on older versions of Windows.  One
> can customize Emacs to use it, of course.

OK. I think it is available on XP. Perhaps it has fewer command line
options than on Windows 7 where I looked at the help output.

> (My personal reason for not using findstr is that I don't want to
> learn yet another tool with yet another set of incompatible options.
> But that's me.)

I was thinking of the scenario where the user ran grep/rgrep and it just
worked on Windows because it used findstr underneath. So only one
person had to learn about it. 

It would be pretty cool if people did not have to go hunting for a
grep.exe.

-- 
Vagn Johansen


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Warning to those using rgrep on Mac OS X
  2012-12-20  9:57           ` Vagn Johansen
@ 2012-12-20 16:20             ` Eli Zaretskii
  0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2012-12-20 16:20 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Vagn Johansen <gonz808@hotmail.com>
> Date: Thu, 20 Dec 2012 10:57:21 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> > Not exactly due to portability problems, but due to the fact that
> >> > there are so many broken ports of 'find' and 'xargs', at least for
> >> > Windows, out there.  
> >> 
> >> Why not use findstr on Windows then?
> >
> > If you mean by default, then the reason is that findstr is very weak
> > and incompatible (or non-existent) on older versions of Windows.  One
> > can customize Emacs to use it, of course.
> 
> OK. I think it is available on XP. Perhaps it has fewer command line
> options than on Windows 7 where I looked at the help output.

I wasn't thinking about XP.  Emacs still supports Windows 98.

> > (My personal reason for not using findstr is that I don't want to
> > learn yet another tool with yet another set of incompatible options.
> > But that's me.)
> 
> I was thinking of the scenario where the user ran grep/rgrep and it just
> worked on Windows because it used findstr underneath. So only one
> person had to learn about it. 

Only for the default switches.  If you need something non-default,
you'd have to learn it.

> It would be pretty cool if people did not have to go hunting for a
> grep.exe.

Feel free to file a feature request with the Emacs bug tracker.



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-12-20 16:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.15544.1355767438.855.help-gnu-emacs@gnu.org>
2012-12-18  9:28 ` Warning to those using rgrep on Mac OS X Aidan Gauland
2012-12-18 10:27   ` Thierry Volpiatto
2012-12-18 17:34     ` Eli Zaretskii
2012-12-18 18:07       ` Thierry Volpiatto
2012-12-18 19:13         ` Eli Zaretskii
2012-12-18 19:33           ` Thierry Volpiatto
2012-12-18 20:04             ` Eli Zaretskii
     [not found]     ` <mailman.15621.1355852062.855.help-gnu-emacs@gnu.org>
2012-12-19  8:44       ` Vagn Johansen
2012-12-19 15:35         ` Eli Zaretskii
     [not found]         ` <mailman.15671.1355931355.855.help-gnu-emacs@gnu.org>
2012-12-20  9:57           ` Vagn Johansen
2012-12-20 16:20             ` Eli Zaretskii
2012-12-17 18:03 Perry Smith

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.