Hi Gary,
  I apologize for my earlier email. I should have given the full details.
  I would like to provide it now.

  I have tried your suggestion of setting the cscopeprg to a script that 
contained
  /usr/local/bin/cscope "$@" | sed s@/dir1/@/dir2/@
  But the cscope results still contained the directory /dir1 reference.

  While doing this test, I have observed a strange behavior. If the cscopeprg
  is set to anything other than /usr/bin/cscope and /usr/local/bin/cscope, 
somewhow
  the vim resets them back to /usr/bin/cscope.
  So, I tried replacing the /usr/bin/cscope itself with the script mentioned 
above and
  got the following errors while opening any source files.

Error detected while processing /etc/vimrc:
line   35:
cs_read_prompt EOF: Interrupted system call
Interrupted
Error detected while processing /home/myname/.vimrc:
line    1:
Interrupted
Interrupt: Hit ENTER or type command to continue


  Out of the three solutions that you have suggested, would you please
  elaborate on the third one, ie. "execute cscope as a quickfix command 
(instead of using the :cs 
    commands) and filter its output before being read by vim."  This looks very 
promising to me.



Thanks,
Natesh


----- Original Message ----
From: Gary Johnson <[EMAIL PROTECTED]>
To: Natesh Kedlaya <[EMAIL PROTECTED]>
Cc: vim@vim.org
Sent: Tuesday, May 22, 2007 9:05:30 AM
Subject: Re: How to alter the cscope search results in the vim so that they 
refer to the right files.

On 2007-05-22, Natesh Kedlaya <[EMAIL PROTECTED]> wrote:

> From: Gary Johnson <[EMAIL PROTECTED]>
> Sent: Monday, May 21, 2007 5:30:52 PM

> > On 2007-05-21, Natesh Kedlaya <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >  I am using Vim6.3
> > >  My cscope db was built on a source directory structure 'src1' which was
> > >  mounted on /dir1. If I use this cscope db in my vim, my cscope query 
> > > would
> > >  yeild following results.
> > [...]
> > >   Any pointers appreciated.
> > 
> > You asked this question before on May 3 and May 7 and I replied with 
> > a suggestion.  Did you try that?

> Hi Gray,
>    Yes, I have tried it. But, no luck.

No luck in that cscope commands still tried opening the /dir1 files?  
No luck in that cscope commands didn't work at all?

Vim has no way that I know of of altering the names it gets from 
cscope, so I think the only alternatives are:

1.  correct the cscope database (e.g., apply a sed command to change 
    /dir1 to /dir2 when copying the database),
2.  insert a filter between cscope and vim (e.g., with a wrapper 
    script around cscope),
3.  execute cscope as a quickfix command (instead of using the :cs 
    commands) and filter its output before being read by vim.

If you would like help in getting any of those to work, we're going 
to have to know exactly what you tried and exactly what happened 
when it didn't work.

It will also help to keep the conversation on the list (I cc'd 
vim@vim.org) so that others can follow the discussion and 
contribute.

Regards,
Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Mobile Broadband Division
                             | Spokane, Washington, USA





      
____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

Reply via email to