Comments (22)
Sounds good. If you find any new issues, don't hesitate to report.
from counsel-etags.
Windows has its own find.exe
. If you install cygwin/msys2
to its default location (drivers doesn't matter). The correct find
will be AUTOMATICALLY found. Or else, you need (setq counsel-etags-find-program "c:\\\\whatever-path\\\\bin\\\\find.exe")
by yourself.
from counsel-etags.
Ah, that is good to know. However, after pointing counsel-etags to the gnu-find.exe I get the following message:
C:/bin/find.exe . ( -iwholename "/.vscode/" -or -iwholename "/extern/" -or -iwholename "/deps/" -or -iwholename "/build/" -or -iwholename "/.git/" -or -iwholename "/.svn/" -or -iwholename "/.cvs/" -or -iwholename "/.bzr/" -or -iwholename "/.hg/" -or -iwholename "/bin/" -or -iwholename "/fonts/" -or -iwholename "/images/" -or -iwholename "/.DS_Store/" -or -iwholename "/.npm/" -or -iwholename "/.tmp/" -or -iwholename "/.sass-cache/" -or -iwholename "/.idea/" -or -iwholename "/node_modules/" -or -iwholename "/bower_components/" -or -iwholename "/.tox/" -or -iwholename "/.cask/" ) -prune -o -type f -not -size +800k -not -name ".clang-format" -not -name ".json" -not -name ".log" -not -name "tags" -not -name "TAGS" -not -name ".gz" -not -name ".zip" -not -name ".tar" -not -name ".rar" -not -name "GTAGS" -not -name "GPATH" -not -name "GRTAGS" -not -name "cscope.files" -not -name "bundle.js" -not -name "min.js" -not -name "min.css" -not -name ".png" -not -name ".jpg" -not -name ".jpeg" -not -name ".gif" -not -name ".bmp" -not -name ".tiff" -not -name ".ico" -not -name ".doc" -not -name ".docx" -not -name ".xls" -not -name ".ppt" -not -name ".pdf" -not -name ".odt" -not -name ".obj" -not -name ".o" -not -name ".a" -not -name ".dylib" -not -name ".lib" -not -name ".d" -not -name ".dll" -not -name ".exe" -not -name ".metadata*" -not -name ".class" -not -name ".war" -not -name ".jar" -not -name "flymake" -not -name "##" -not -name ".#" -not -name ".swp" -not -name "~" -not -name ".elc" -not -name ".pyc" -print | ctags -e -L -: exited abnormally with code 255.
Any idea what that could be?
from counsel-etags.
you may need set ctags.exe
too. check counsel-etags-tags-program
from counsel-etags.
Hm, ctags is in my path so I'm pretty sure it is found.
counsel-etags-tags-program is nil in my emacs, so the value is picked automatically. Are you suggesting I overwrite the value with the absolute path to the executable?
from counsel-etags.
Run ctags
in dos window, what's output?
Please run that cli in Dos window (replace c:/bin/find.exe
with c:\bin\find.exe
at first)? what's the output?
from counsel-etags.
D:\Workspace\p2render>C:\bin\find.exe . ( -iwholename "/.vscode/" -or -iwholename "/tools/" -or -iwholename "/extern/" -or -iwholename "/deps/" -or -iw
holename "/build/" -or -iwholename "/.git/" -or -iwholename "/.svn/" -or -iwholename "/.cvs/" -or -iwholename "/.bzr/" -or -iwholename "/.hg/" -or -
iwholename "/bin/" -or -iwholename "/fonts/" -or -iwholename "/images/" -or -iwholename "/.DS_Store/" -or -iwholename "/.npm/" -or -iwholename "/.tmp
/" -or -iwholename "/.sass-cache/" -or -iwholename "/.idea/" -or -iwholename "/node_modules/" -or -iwholename "/bower_components/" -or -iwholename "/.
tox/" -or -iwholename "/.cask/" ) -prune -o -type f -not -size +800k -not -name ".clang-format" -not -name ".json" -not -name ".log" -not -name "tags" -no
t -name "TAGS" -not -name ".gz" -not -name ".zip" -not -name ".tar" -not -name ".rar" -not -name "GTAGS" -not -name "GPATH" -not -name "GRTAGS" -not -name "
cscope.files" -not -name "bundle.js" -not -name "min.js" -not -name "min.css" -not -name ".png" -not -name ".jpg" -not -name ".jpeg" -not -name ".gif" -n
ot -name ".bmp" -not -name ".tiff" -not -name ".ico" -not -name ".doc" -not -name ".docx" -not -name ".xls" -not -name ".ppt" -not -name ".pdf" -not -na
me ".odt" -not -name ".obj" -not -name ".o" -not -name ".a" -not -name ".dylib" -not -name ".lib" -not -name ".d" -not -name ".dll" -not -name ".exe" -
not -name ".metadata*" -not -name ".class" -not -name ".war" -not -name ".jar" -not -name "flymake" -not -name "##" -not -name ".#" -not -name ".swp" -no
t -name "~" -not -name ".elc" -not -name ".pyc" -print | ctags -e -L -
C:\bin\find.exe: paths must precede expression
Usage: C:\bin\find.exe [-H] [-L] [-P] [path...] [expression]
So it's still a problem with my find program. I wonder what that means.
EDIT:
I found this thread on stackoverflow that might contain some hints to the problem.
When I try the older find version that is mentioned I get a different error message:
C:\bin\find.exe: invalid predicate `-iwholename'
I'm not sure I understand 100%, but apparently it is possible to provide find arguments that work both on linux and windows. Would you even be interested in accepting such things in counsel-etags?
from counsel-etags.
install cygwin or msys, we only support GNU Find
and BSD Find
.
from counsel-etags.
C:\bin>find --version
GNU find version 4.2.20
Features enabled: CACHE_IDS D_TYPE
Do you think the problem would be resolved by installing cygwin? I will do some more research.
from counsel-etags.
What's output of find --help
, looks you find.exe
is correct.
from counsel-etags.
C:\bin>find --help
Usage: find [path...] [expression]default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:operators (decreasing precedence; -and is implicit where no others are given):
( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2
EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2positional options (always true): -daystart -follow
normal options (always true, specified before other expressions):
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
--version -xdev -ignore_readdir_race -noignore_readdir_racetests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME
-ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN
-links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE
-nouser -nogroup -path PATTERN -perm [+-]MODE -regex PATTERN
-wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
-used N -user NAME -xtype [bcdpfls]actions: -exec COMMAND ; -fprint FILE -fprint0 FILE -fprintf FILE FORMAT
-fls FILE -ok COMMAND ; -print -print0 -printf FORMAT -prune -ls -delete
-quitReport (and track progress on fixing) bugs via the findutils bug-reporting
page at http://savannah.gnu.org/ or, if you have no web access, by sending
email to [email protected].
from counsel-etags.
This is getting more and more mysterious.
- It really has to be (setq counsel-etags-find-program "C:\bin\find.exe"). Unix style path doesn't work in this case for some reason.
- The GNU find version I was using still doesn't work. The TAGS file stays empty.
- I extracted find (and its dependencies) from cygwin. Now a TAGS file is created and filled with content, but using it leads to unexpected results. Basically the tags cannot be used.
- The only thing that works for me so far, is just calling something like "ctags -Re --exclude=build --exclude=deps --exclude=extern --exclude=tools". Afterwards I can navigate the tags as expected.
from counsel-etags.
just double check:
first, your are running native windows version
second, you have not setup any term or shell in your .emacs
. So I suppose Emacs will start a dos shell to run cli
third, you are using GNU Find and CTags.
At last, if you want to setup programs manually, please follow my sample (setq counsel-etags-find-program "c:\\\\whatever-path\\\\bin\\\\find.exe")
, note the extra slashes. Please note you need setup both find and ctags to be sure.
If you just install Cygwin (64bit) to the default location and have not done any extra setup in your .emacs
, this plugin should work out of box.
I've tested on Windows 7 and 10. It works.
from counsel-etags.
I installed cygwin now. counsel-etags automatically finds the cygwind find.exe and generates the tags. The outcome, however, is the same as point 3 in my previous post. It will for example open a new buffer with the name of the file where a certain symbol is defined, but the buffer will be empty.
Comparing the contents of the TAGS file created "manually" and the one by counsel-etags, I notice that the manual TAGS file contains relative file paths, while the other file contains absolute file paths. Is there an option for counsel-etags to adjust this behavior?
EDIT:
I tried
(when is-win
(setq counsel-etags-tags-program "C:\\bin\\ctags.exe -Re -L")
)
and it does what I intended to achieve, but the generated TAGS file is exactly the same as without the adjustment.
from counsel-etags.
Ok, now I know what happens, (setq counsel-etags-project-root "the/directory/of/your/tag-file")
.
Another solution (if you prefer create tags file by yourself):
Search counsel-etags-update-tags-backend
in README. You can use your own way to create tags.
See https://emacs.stackexchange.com/questions/19075/regenerate-ctags-tags-file-without-freezing-emacs-for-a-while/38911#38911 for the technique not to block user input when generating ctags.
from counsel-etags.
Ah, but then I can only have a single tag-file-root, right? Generally counsel-etags seemed to perform perfectly fine with different tag files in different project directories, even when switching buffers and so on. Is there a way to make counsel-etags automatically select the project root to the directory where the tag file is created? It sounds confusing while I write it, but I guess it is a matter of changing the working directory when executing ctags or something.
from counsel-etags.
counsel-etags
will detect project root automatically if you use git/svn/hg to manage code, see counsel-etags-project-file
if you want it support more project types. Or you can use https://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Local-Variables.html to setup per directory variables?
Can you do code navigation after seting project root?
If not, could you give me more details about your setup, OS, Emacs, the CLI tools you use?
from counsel-etags.
I tested v1.5.0 on windows 7, 10. Install Cygwin and its package ctags
, and run M-x counsel-etags-find-tag-at-point
. It works out of box.
from counsel-etags.
Maybe we misunderstood each other. I believe the project root selection works just fine. I manually created tag files for two different projects and could freely switch between the two and do code navigation.
My problem is more like this: I have open file A and B of the same project without any tags. I use counsel-etags to crate the tags. I press M-. in file A, the symbol is defined in file B, and I end up in an empty buffer called B<2>.
This does not happen with the manually created tag files, for some reason. The only difference I noticed was absolute paths in counsel-etags generated tag files, and paths relative to project root in the other case. That's why I was curious whether it is possible to change the working directory before calling ctags.
from counsel-etags.
Check v1.5.0
the relative path is always relative to the file TAGS
from counsel-etags.
I used melpa to update counsel-etags. counsel-etags.el has version 1.5.0 written in it. Everything actually works now, although the generated tags file looks exactly the same as before. Absolute file paths that is. Not that it really matters, but still interesting to see, that we get such different behavior on windows.
from counsel-etags.
Thanks for helping me out!
from counsel-etags.
Related Issues (20)
- counsel-etags-grep cant' follow parameters? HOT 6
- Issue with creating a TAGS file when in Tramp mode HOT 2
- counsel-etags did not auto update TAG file. HOT 11
- need CI and tdd HOT 1
- How to color candidate/selection when 'counsel-etags-grep' like swiper does? HOT 8
- could add function name in when looking up tags
- how to do case insensitive grep? HOT 4
- When calling "counsel-etags-find-tag-at-point", rg report separator is error HOT 6
- Unable to use counsel-etags-grep under the windows version of emacs (spacemacs) HOT 3
- Ctags Will Scan Code When Jump Next Tag HOT 12
- How to go back to previous position after I executed counsel-etags-find-tag-at-point ? HOT 2
- 如何指定tag的输出路径 HOT 4
- about ctags cache HOT 4
- counsel-etags-find-tag-at-point-other-window
- How can I append external tags? HOT 4
- Please don't provide a feature in my-byte-compile HOT 2
- "No tag is found." although TAGS file contains this tag HOT 6
- Counsel-etags-grep can only find results in some files HOT 6
- 当tag搜索不到想要的内容时回退到使用ripgrep HOT 4
- 调用 counsel-etags-grep 时可以忽略tag文件 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from counsel-etags.