1

I got thankfully introduced to use helm and helm-projectile for all the goodies it has and especially the helm-projectile-grep-search. I must say, this supercharged Emacs by a long shot. I learned that from this great tutorial : http://tuhdo.github.io/helm-projectile.html. Unfortunately, everyhting else was fine except grep search-related commands, they throwed this error by invoking them on my machine:

Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil) [6 times] Error running timer helm-projectile-grep-or-ack: (wrong-type-argument stringp nil)

The same error was issued when I used C-s or C-u C-s recursive grep search while in helm-find-files bound to C-x C-f. I run this on marked files with C-SPC.

But rgrep works well which is built in Emacs (see image below). So I don't know what am I missing to get grep search work.

enter image description here

Notes
Machine: Windows 7 32bit.
Emacs 24.4
Helm/Projectile/Helm-projectile all updated from MELPA.

I have installed Cygwin and added to Path:

enter image description here

  • rgrep used the built-in grep (written in Elisp) while helm-projectile-grep needs the external grep. If you don't like Cygwin, probably you should look at Mingw-w64, install it and set $PATH point to its binary directory. – Tu Do Jan 8 '15 at 18:09
  • @TuDo still not working I tried MingW and Cygwin32. I have my emacs in c:\emacs not in program files. I added to path c:\cygwin\bin. What am I missing? – doctorate Jan 8 '15 at 20:04
  • how to know if my cygwin is installed properly and recognized by emacs? I run M-x projectile-grep and it returns: Grep exited abnormally with code 123. So meaning cygwin not in charge, right? – doctorate Jan 8 '15 at 20:10
  • You put the directory at the beginning of Path variable, so cygwin binaries are alwaysbused first. Also to makw sure, in Emacs execute getenv command and type "PATH" (without double quotes) to verify the value. – Tu Do Jan 9 '15 at 1:53
  • @TuDo Now when I issue M-x getenv RET PATH RET, the C:\cyqwin\bin appears first, restart Emacs, I get the same error when doing grep search. – doctorate Jan 9 '15 at 8:03
1

So now it worked when I installed 'Gow'; a lightweight version with a small file size about 18 MB compared to the heavy Cygwin over 100 MB as described by this source: https://github.com/bmatzelle/gow/wiki. Very easy to install. Just make sure that the binary path to environmental variables is right there (it was automatically added after installation didn't need to add it manually). Restart Emacs. No need to restart machine. Cygwin installation was not user-friendly at all.

Select files to run grep on by C-SPC or all M-a:

enter image description here

Press C-s for grep search and you get online matching. Just great!
enter image description here

Update
After installing Gow it worked well, but after restarting my machine and for some reason Emacs could not pick up Gow right. But adding these two lines of code to my init.el solved that:

(setq exec-path (add-to-list 'exec-path "C:/Program Files/Gow/bin"))
(setenv "PATH" (concat "C:\\Program Files\\Gow\\bin;" (getenv "PATH")))  

Now when I run getenv PATH from eshell, the binary path to Gow shows first. This might be important to get things set.

  • Congratulation. So, did helm-projectile-grep work as well? – Tu Do Jan 9 '15 at 11:00
  • 1
    @TuDo, Thanks! I am really glad that you introduced me to it. Now I am experiencing E-MAX rather than just Emacs. BTW, grep version from eshell reads: GNU grep 2.5.4 – doctorate Jan 9 '15 at 11:04
  • @TuDo, when I mark all files M-a I wish there was a way to change that and demark them by another M-a, like what C-SPC does. May be a feature request. – doctorate Jan 9 '15 at 11:08
  • Press M-a again, and they will be unmarked. That command is for toggling. – Tu Do Jan 9 '15 at 11:10
  • Unfortunately, M-a does not toggle with me as C-SPC! – doctorate Jan 9 '15 at 11:11

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.