2

When I use Emacs on a Linux OS, I search through files with rgrep. On Windows machine this takes some additional setup. Is there an Emacs-powered solution for searching through multiple files that does not depend on external utilities?

  • 3
    That would be really, really slow... There would be no way around creating at least a temporary buffer and reading all of it. Anywhat scalable solution would require an external program. I mean, this is doable, but you won't like it :) – wvxvw Feb 9 '15 at 16:35
  • That's a good point. Org agenda certainly takes a long time to generate, and most of that is just reading files into buffers. – Matthew Piziak Feb 9 '15 at 17:06
  • 1
    If the buffers that you want to search in are already open, multi-occur can help you. Here's a little blog post by Mickey Peterson on Searching in Buffers with Occur Mode. – Kaushal Modi Feb 10 '15 at 22:14
  • Do the additional set-up to get a real grep binary (and other 'standard' external tools). Just consider it a standard part of installing Emacs on Windows. – phils Feb 10 '15 at 22:51
  • @phils, I generally do. Sometimes I feel like I'm installing system calls to a de facto Emacs operating system. All the same, I'm curious of the alternatives, and in some constrained situations a native solution may come in handy. – Matthew Piziak Feb 10 '15 at 23:14
4

ernie is a 100% Emacs Lisp script that can be used as a drop-in replacement for grep making it easy to grep using the native version of Emacs on Windows

I have not tried it, but there you go.

3

Eshell contains a grep implementation in em-unix.el known as eshell-poor-mans-grep. As the name indicates, you shouldn't be using this since it's slow and eats lots of memory to get the job done. But considering you don't want to use anything external, why not give this internal tool a try...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.