help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Working rgrep in windows emacs in 2024? (GNU emacs 29.1, windows 11


From: Eli Zaretskii
Subject: Re: Working rgrep in windows emacs in 2024? (GNU emacs 29.1, windows 11 Enterprise)
Date: Tue, 13 Feb 2024 15:28:24 +0200

> From: Steinar Bang <sb@dod.no>
> Date: Tue, 13 Feb 2024 12:20:50 +0100
> 
> I've used emacs for many years on many platforms, including windows.
> 
> One thing I use a lot on linux (and MacOS when I had that), is rgrep and
> 'C-c p s g' in projectile.
> 
> And rgrep is something I have never managed to get working on windows.

FWIW, rgrep works for me on MS-Windows.

> I've messed with setting the PATH environment variable (from my .emacs)
>    (if windows-emacs
>         (setenv "PATH" (concat 
> "c:\\ProgramFiles\\ezwinports\\bin;C:\\ProgramFiles\\GnuWin32\\bin;" (getenv 
> "PATH"))))
> and I've tried adding to the exec-path
>     (when windows-emacs
>         (push "C:/ProgramFiles/GnuWin32/bin" exec-path)
>         (push "c:/ProgramFiles/ezwinports/bin" exec-path))

I don't do that because the directory with ports of GNU software,
including 'find' and 'grep', is on my system-wide PATH.

Does Emacs find find.exe and grep.exe if you try it with
executable-find, like this:

  M-: (executable-find "find") RET
  M-: (executable-find "grep") RET

> But neither of the above settings have ever given me a working rgrep.

Which means what?  What do you see if you try invoking rgrep?  Please
show everything you type at rgrep's prompts and the output and/or
error messages you get as result.

> Ezwinports is Emacs maintainer Eli Zaretskii's old port of linux/unix
> command line tools to windows:
>  https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/EZWinPorts.html
> 
> Do these still work for 64bit windows?

Yes.  I use them every day on 64-bit Windows 11.

> Are they recommended over GnuWin32?

Yes.

> Then there is GnuWin32
>  https://gnuwin32.sourceforge.net/
> 
> It doesn't look maintained, judging from the dates on the front page...?

Yes.

> The grep is from February 2009
>  https://gnuwin32.sourceforge.net/packages/grep.htm
> The find is fron April 2005
>  https://gnuwin32.sourceforge.net/packages/findutils.htm

Don't use those, use the ones from ezwinports: they are old, but they
do the job.  Or install newer ports from the MSYS2 site (but be sure
to install MinGW64 ports, not MSYS ports).  I don't use those, but
many others do.

> Does anyone else have a working rgrep in a recent emacs on a recent
> windows on amd64, they would like to share?

I just tried

  M-x rgrep RET DOS_NT RET .[ch] RET /path/to/emacs RET

(where /path/to/emacs was replaced with the actual top-level directory
of the Emacs source tree), and pronto saw the list of 178 matches in
the current Emacs tree.

So yes, it works here, but I'm not sure what can I share, except what
I wrote above.



reply via email to

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