How do I specify multiple file extensions in rgrep?
I tried *. {cc, hh} but it doesn't work (it only works for lgrep). I also tried the method that suggested it e http://compgroups.net/comp.emacs/searching-multiple-file-types-with-rgrep/95027 , but interactive mode seems to prevent me from entering space. Any idea?
+3
source to share
2 answers
I was (desperate) rolling out an ellipse solution:
(defun mrgrep (pattern extensions dir)
(interactive "ssearch for: \nsextensions (space separated, no *): \nD")
(setq includes (mapconcat (lambda (ext)
(concat (format "--include=\"\\*%s\"" ext)))
(s-split " " extensions)
" "))
(setq cmd (format "grep -ir %s %s %s"
includes
pattern
(concat dir "*")))
(setq cmd (read-from-minibuffer "run grep like this: " cmd))
(compilation-start cmd 'grep-mode)
)
but phils explained how to enter space!
0
source to share