counsel-etags
counsel-etags copied to clipboard
Unable to use counsel-etags-grep under the windows version of emacs (spacemacs)
Hi, I am using emacs 27.1 under windows 10. And I installed counsel-etags by adding it to the dotspacemacs-additional-packages. If I use counsel-etags-grep to search for something, it says
No project found. You can create tags file using ‘counsel-etags-scan-code’. So we don’t need the project root at all. Or you can set up ‘counsel-etags-project-root’.
So I executed the following code for a directory with cmd:
ctags --exclude="/.git/" --exclude=".git/" --exclude="/.svn/" --exclude=".svn/" --exclude="/.cvs/" --exclude=".cvs/" --exclude="/.bzr/" --exclude=".bzr/" --exclude="/.hg/" --exclude=".hg/" --exclude="/bin/" --exclude="bin/" --exclude="/fonts/" --exclude="fonts/" --exclude="/images/" --exclude="images/" --exclude="/.DS_Store/" --exclude=".DS_Store/" --exclude="/.npm/" --exclude=".npm/" --exclude="/.tmp/" --exclude=".tmp/" --exclude="/.sass-cache/" --exclude=".sass-cache/" --exclude="/.idea/" --exclude=".idea/" --exclude="/node_modules/" --exclude="node_modules/" --exclude="/bower_components/" --exclude="bower_components/" --exclude="/.tox/" --exclude=".tox/" --exclude="/.vscode/" --exclude=".vscode/" --exclude="/.cask/" --exclude=".cask/" --exclude=".log" --exclude="rusty-tags.vim" --exclude="rusty-tags.emacs" --exclude="tags" --exclude="TAGS" --exclude=".tgz" --exclude=".gz" --exclude=".xz" --exclude=".zip" --exclude=".tar" --exclude=".rar" --exclude="GTAGS" --exclude="GPATH" --exclude="GRTAGS" --exclude="cscope.files" --exclude="bundle.js" --exclude="min.js" --exclude="min.css" --exclude=".png" --exclude=".jpg" --exclude=".jpeg" --exclude=".gif" --exclude=".bmp" --exclude=".tiff" --exclude=".ico" --exclude=".doc" --exclude=".docx" --exclude=".xls" --exclude=".ppt" --exclude=".pdf" --exclude=".odt" --exclude=".clang-format" --exclude=".obj" --exclude=".so" --exclude=".o" --exclude=".a" --exclude=".ifso" --exclude=".tbd" --exclude=".dylib" --exclude=".lib" --exclude=".d" --exclude=".dll" --exclude=".exe" --exclude=".metadata*" --exclude=".class" --exclude=".war" --exclude=".jar" --exclude="flymake" --exclude="##" --exclude=".#" --exclude=".swp" --exclude="~" --exclude=".elc" --exclude=".pyc" -e -R
Now when I am searching again, it shows
Wrong type argument: listp, "In some shells on Windows '/' is automatically expanded. Use '//' instead." So how can I make counsel-etags-grep work for emacs 27.1 under Windows?
The easiest way is to install Cygwin
which contains grep
command line executable. This package can find grep in Cygwin's default installation directory.
Or else you need set environment variable PATH
which should includes the directory of executable.
If rg
(executable of ripgrep) is used for text grep, make sure its directory is included in PATH
.
ripgrep has its own path problem, but was worked around in latest version. See https://github.com/redguardtoo/counsel-etags/issues/74
If you still have a problem, send me the detailed steps and a minimum sample project.
Thank you very much, I installed Cygwin and removed the rg path from the PATH, now it works 👍
latest version should solve this problem. now you can use ripgrep.