please see my comments inline.
> The gtags.vim script only worked on windows if I changed the following line:
> let stuff = system(cmd . '>' . tmpfile)
> let stuff = system(cmd . '| tee ' . tmpfile)
It seems that the gtags.vim which you are using is version-0.2.
A new version 0.3 was released the other day as a part of GLOBAL-5.7.
In this version, starting method of programs was changed.
Could you please try it if you have time?[Ritesh] Thanks, I tried this to do this. It gives the same error. However, on double checking, global-0.7 tar only contains version 0.2 (so no surprise). Could you send the gtags.vim you mention ? As I explained its to do with the system() with '>' on Windows (as far as I could get it).
> Another change I did (since the default global format is wasteful in printing the pattern
> search on each line) is to change the following wrt errorformat and global cmdline.
> let cmd = 'global' . sep . '-tq' . option . sep . pattern
> let cmd = 'global' . sep . '--result grep -q' . option . sep . pattern
> This obviates the need to change the default errorformat :-)
In the latest version, the format option was changed from -t to -x so that
you can see line images in the list. Could you please try it too?[Ritesh] Here is the output using -t, -x, and --result grep. For me personally, grep mode works best-----> Using '-x' -------------->|| saveenv_copy 329 u-boot/common/upgrade.c saveenv_copy();|| saveenv_copy 164 users/ifx/utilities/command.c int saveenv_copy()-----> Using '-t' -------------->|| saveenv_copy
u-boot/common/upgrade.c 329|| saveenv_copy users/ifx/utilities/command.c 164-----> Using '--result grep' -------------->|| Global:Searching [-g] for [saveenv_copy]u-boot\common\upgrade.c|329| saveenv_copy();users\ifx\utilities\command.c|164| int saveenv_copy()
------------------------------->As you can see, the '--result grep' has less duplication and looks cleaner. It also works w/o changing
errorformat :-). Would be good to atleast have it as an option depending on preference. Please note, in case of gtags -r or gtags -g, the 'grep' method is able to show more of the matched line w/o wrap etc. However, maybe, this is subjective.
> Finally, to speed up the script processing, I commented out all previous execution lines
> from the "system" function call, and added in its place
> cex! printf("Global:Searching [-%s] for [%s]", option, pattern)
> caddex! system(cmd)
Currently we don't use the caddexpr command, because we need to count number of records
from global(1). If there is an good idea, please tell me.[Ritesh] I didn't get this, I am afraid ? I don't need to count any lines. vim quickfix takes care of everything, its OS independent, and its faster than the other method... In case of no match, we onlu get the print like
"Global:Searching [-r] for [saveenv_copy]" makes it reasonably obvious if there is no match...
Thank you for your suggestions![Ritesh]You are welcome :-) Just providing my 2c back in hope of benefiting others (and myself). Could you update gtags.vim version 0.3 on vim plugin site ? I'll give it a try.
Shigio YAMAGUCHI <address@hidden
> - GNU Project
PGP fingerprint: D1CB 0B89 B346 4AB6 5663 C4B6 3CA5 BBB3 57BE DDA3