why doesn't gvim7.2 work with cscope

258 views
Skip to first unread message

枫林

unread,
Jun 22, 2009, 8:21:18 AM6/22/09
to vim...@googlegroups.com
hi
   all
   I use cscope for window, it works well in dos,but when I use cscope in vim("cs add cscope.out"), vim says that E623:can't cause cscope process.
  thanks
waynefan

Tony Mechelynck

unread,
Jun 22, 2009, 11:39:59 AM6/22/09
to vim...@googlegroups.com

Cscope works perfectly for me with gvim 7.2 on Linux. However, I know
that the Vim-cscope interface on Windows is "different". A few caveats
though:

- the cscope.out database must be built separately (by invoking cscope
yourself, either at the command-line or via a :!cscope -b <something>
command in Vim) before you can ":cs add" it.
- The Win32 version of cscope works with Vim, but not the Dos32 DJGPP
version.
- And, of course, you need +cscope compiled-in to use it (i.e., ":echo
has('cscope')" must return a nonzero value, usually 1).

See:
:help cscope-howtouse
:help cscope-limitations


Best regards,
Tony.
--
If you live in a country run by committee, be on the committee.
-- Graham Summer

枫林

unread,
Jun 23, 2009, 9:46:54 AM6/23/09
to vim...@googlegroups.com
hi
  tony
  thanks a lot.
  I have found the problem, it is that the "csprg" parameter is set up error. I set it to "C:\Program Files\Vim\vimfiles\cscope.exe" but "csprg" parameter can't include the space in the path name, so gvim can't find the cscope.exe and gvim could work with cscope.
 
Best regards
waynefan

2009/6/22 Tony Mechelynck <antoine.m...@gmail.com>

Tony Mechelynck

unread,
Jun 24, 2009, 2:32:26 AM6/24/09
to vim...@googlegroups.com
On 23/06/09 15:46, 枫林 wrote:
> hi
> tony
> thanks a lot.
> I have found the problem, it is that the "csprg" parameter is set up
> error. I set it to "C:\Program Files\Vim\vimfiles\cscope.exe" but
> "csprg" parameter can't include the space in the path name, so gvim
> can't find the cscope.exe and gvim could work with cscope.
> Best regards
> waynefan

Well, either replace Program Files by PROGRA~1 in the option, or modify
your PATH so that the directory containing cscope.exe is included, and
set back 'csprg' to its default.

Best regards,
Tony.
--
How many seconds are there in a year? If I tell you there are
3.155 x 10^7, you won't even try to remember it. On the other hand,
who could forget that, to within half a percent, pi seconds is a
nanocentury.
-- Tom Duff, Bell Labs

Ben Fritz

unread,
Jun 24, 2009, 10:43:30 AM6/24/09
to vim_use


On Jun 23, 8:46 am, 枫林 <jacob...@gmail.com> wrote:
> I have found the problem, it is that the "csprg" parameter is set up
> error. I set it to "C:\Program Files\Vim\vimfiles\cscope.exe" but "csprg"
> parameter can't include the space in the path name, so gvim can't find the
> cscope.exe and gvim could work with cscope.
>

Why do you think csprg can't include the space? Have you tried setting
it like "set csprg=C:\Program\ Files\Vim\vimfiles\cscope.exe" like
you'd do with any other option in which you want to include a space?
Or am I missing something?

Tony Mechelynck

unread,
Jun 24, 2009, 11:02:31 AM6/24/09
to vim...@googlegroups.com

I thought the OP had done either that or

let csprg='C:\Program Files\Vim\vimfiles\cscope.exe'

etc., and that it didn't work when trying to execute the 'csprg' setting
as an external prog. If you define it with no spaces in it, you won't
have all the problems I've seen recently on vim_use and/or vim_dev when
trying to invoke a program with a space in it, e.g., Vim would try to
execute

C:\Program Files\Vim\vimfiles\cscope.exe <something>

and Windows would try to execute the program "C:\Program.exe" or
"C:\Program.bat" with the parameters "Files\Vim\vimfiles\cscope.exe" and
"<something>". If you define 8.3 paths (with no spaces in them), or even
replace just the space-containing path component(s) with its/their 8.3
equivalent(s), you don't run into this kind of problems.


Best regards,
Tony.
--
Any stone in your boot always migrates against the pressure gradient to
exactly the point of most pressure.
-- Milt Barber

Ben Fritz

unread,
Jun 24, 2009, 11:46:25 AM6/24/09
to vim_use


On Jun 24, 10:02 am, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> If you define it with no spaces in it, you won't
> have all the problems I've seen recently on vim_use and/or vim_dev when
> trying to invoke a program with a space in it, e.g., Vim would try to
> execute
>
>         C:\Program Files\Vim\vimfiles\cscope.exe <something>
>
> and Windows would try to execute the program "C:\Program.exe" or
> "C:\Program.bat" with the parameters "Files\Vim\vimfiles\cscope.exe" and
> "<something>". If you define 8.3 paths (with no spaces in them), or even
> replace just the space-containing path component(s) with its/their 8.3
> equivalent(s), you don't run into this kind of problems.
>

Hmm, it looks like Vim doesn't automatically add the " characters
then. I assumed it would use 'shellquote' but apparently this is not
the case. Is there a reason 'shellquote' is not used for csprg,
makeprg, etc.?

A user could include the quotes manually, correct? E.g. :set csprg="C:
\Program\ Files\Vim\vimfiles\cscope.exe" would work fine, would it not?

Tony Mechelynck

unread,
Jun 24, 2009, 12:03:10 PM6/24/09
to vim...@googlegroups.com

I don't know. OTOH replacing Program Files by PROGRA~1 will work
correctly regardless of backslash-escaping, quoting, or whatever.


Best regards,
Tony.
--
When I was a boy I was told that anybody could become President. Now
I'm beginning to believe it.
-- Clarence Darrow

Reply all
Reply to author
Forward
0 new messages