unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <86v86spk7b.fsf@gnu.org> (raw)
In-Reply-To: <yqoonkl34twip9p.fsf@dod.no> (message from Steinar Bang on Tue, 13 Feb 2024 12:20:50 +0100)

> 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.



  parent reply	other threads:[~2024-02-13 13:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 11:20 Working rgrep in windows emacs in 2024? (GNU emacs 29.1, windows 11 Enterprise) Steinar Bang
2024-02-13 12:23 ` Steinar Bang
2024-02-13 12:32 ` Steinar Bang
2024-02-13 12:55   ` Steinar Bang
2024-02-13 13:47     ` Eli Zaretskii
2024-02-14  7:50       ` Steinar Bang
2024-02-13 13:28 ` Eli Zaretskii [this message]
2024-02-14  8:26   ` Steinar Bang
2024-02-14  9:00     ` Steinar Bang
2024-02-14 15:08       ` Eli Zaretskii
2024-02-14 15:09     ` Eli Zaretskii
2024-02-15  9:40   ` Gregor Zattler
2024-02-15 10:22     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86v86spk7b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).