1

I spend a lot of time searching code. I really like grep and find, because of all the options available. But it takes way too long to navigate the results. I use xemacs and it takes 3 more commands to review each result. Open the file, ctrl+s, and type out the same thing I just grepped for.

After a search, I’m envisioning arrow keying through results, press enter and bam, have the file opened and be staring at the exact line of code listed.

Is there a way to do this?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
user432209
  • 111
  • 1
  • Despite the down votes, I've often thought it would be good to be able to do this as well. Maybe develop your own 'grep' replacement to do what you want? –  Nov 18 '14 at 17:21
  • Probably because grep returns data to standard out. –  Nov 18 '14 at 17:32
  • http://meta.programmers.stackexchange.com/questions/6483/why-was-my-question-closed-or-down-voted/6490#6490 – gnat Nov 18 '14 at 19:33
  • Does [M-x find-grep-dired](http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-and-Find.html#Dired-and-Find) do what you want? – Mark Plotnick Nov 18 '14 at 20:25
  • May find more helpers at http://emacs.stackexchange.com/ . – Mark Plotnick Nov 18 '14 at 20:27
  • I agree, it would have been better to migrate to the Emacs SE. –  Nov 18 '14 at 21:14
  • @Mark Plotnick - I tried out the find-grep-dired. Good suggestion, but the buffer doesn’t show the line of code it matched, only filenames with a match. – user432209 Nov 18 '14 at 21:17

1 Answers1

1

Within XEmacs, "M-x grep" (loaded from 'compile) runs grep in a sub-shell. The output is parsed by compile mode and you can middle-click on any match to go directly to the matching line in the appropriate file.

Although, I just learned today that "M-x igrep" (and "M-x igrep-find") is preferred to "M-x grep"

Am I missing something, that this answer hasn't come up in over 3 years?

jwm
  • 231
  • 2
  • 6