ericdanan/counsel-projectile

counsel-projectile cannot work out with other executable program, such as rg、ag、fzf etc.

jueqingsizhe66 opened this issue · 3 comments

  • counsel-projectile-rg
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)
  counsel--executable-find("rg" t)
  counsel-require-program(("rg" "-M" "240" "--with-filename" "--no-heading" "--line-number" "--color" "never" "--glob" "!\"TAGS\"" "--glob" "!\".idea/\"" "--glob" "!\".vscode/\"" "--glob" "!\".ensime_cache/\"" "--glob" "!\".eunit/\"" "--glob" "!\".git/\"" "--glob" "!\".hg/\"" "--glob" "!\".fslckout/\"" "--glob" "!\"_FOSSIL_/\"" "--glob" "!\".bzr/\"" "--glob" "!\"_darcs/\"" "--glob" "!\".tox/\"" "--glob" "!\".svn/\"" "--glob" "!\".stack-work/\"" "--glob" "!\".ccls-cache/\"" "--glob" "!\".clangd/\"" "%s" "--path-separator" "/" "."))
  counsel-ag(nil "c:/Users/yezhaoliang/AppData/Roaming/.emacs.d/" nil "[.emacs.d] rg: " :caller counsel-rg)
  counsel-rg(nil "c:/Users/yezhaoliang/AppData/Roaming/.emacs.d/" nil "[.emacs.d] rg: ")
  counsel-projectile-rg()
  funcall-interactively(counsel-projectile-rg)
  #<subr call-interactively>(counsel-projectile-rg nil nil)
  apply(#<subr call-interactively> counsel-projectile-rg (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> counsel-projectile-rg nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (counsel-projectile-rg nil nil))
  call-interactively(counsel-projectile-rg nil nil)
  command-execute(counsel-projectile-rg)
  • counsel-projectile-git
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)
  counsel--executable-find("git" t)
  counsel-require-program("git --no-pager grep -n --no-color -I -e \"%s\"")
  counsel-git-grep("Instead" "c:/Users/yezhaoliang/AppData/Roaming/.emacs.d/" nil)
  counsel-projectile-git-grep(nil)
  counsel-projectile-grep()
  funcall-interactively(counsel-projectile-grep)
  #<subr call-interactively>(counsel-projectile-grep nil nil)
  apply(#<subr call-interactively> counsel-projectile-grep (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> counsel-projectile-grep nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (counsel-projectile-grep nil nil))
  call-interactively(counsel-projectile-grep nil nil)
  command-execute(counsel-projectile-grep)
  • counsel-projectile-fzf
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)
  counsel--executable-find("fzf" t)
  counsel-require-program("fzf -f \"%s\"")
  counsel-fzf(nil nil)
  funcall-interactively(counsel-fzf nil nil)
  #<subr call-interactively>(counsel-fzf record nil)
  apply(#<subr call-interactively> counsel-fzf (record nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> counsel-fzf record nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (counsel-fzf record nil))
  call-interactively(counsel-fzf record nil)
  command-execute(counsel-fzf record)
  counsel-M-x-action("counsel-fzf")
  #f(compiled-function (x) #<bytecode 0xda3a3ad>)("counsel-fzf")
  ivy-call()

I don't think this is an issue with counsel-projectile (you could confirm this by calling counsel-rg or counsel-ag etc instead). What is your emacs version? Is your counsel up-to-date?

Yes, you are right. counsel-rg or counsel-ag is the cause of the problem.
My emacs version is Emacs27.0(Windows); Counsel is the newest version.

I think your issue should be solved if you update emacs to the latest stable version version 27.1 (see the code of counsel--executable-find in counsel).