How to launch kate from cscope?

0

I tried setting EDITOR to kate and starting cscope. Unfortunately, whevenever cscope launches kate:

kate +LINE FILE.c 

the editor ignores the +line flag treating it as just another (non-existant) file instead of opening the file.c on the requested line...

I can't believe, the editor can be quite so stupid -- there must be a trick to make it work properly. What is it?

Mikhail T.

Posted 2014-12-26T14:45:53.843

Reputation: 419

Answers

0

Thanks to user14164's answer above for the pointer. Looking through cscope's own man-page, I found a way to teach it, how to invoke editors, which -- like kate -- don't recognize the +LINE notation. By launching cscope this way:

env CSCOPE_LINEFLAG=-l%s CSCOPE_EDITOR=kate cscope

Then, by replacing kate with a wrapper, that launches real kate in the background (with kate's chatty stderr redirected to /dev/null)

#!/bin/sh
exec kate "$@" 2> /dev/null &

I get the gvim-like functionality (where cscope remains available while the launched editor is running) without gvim's multitude of windows.

Mikhail T.

Posted 2014-12-26T14:45:53.843

Reputation: 419

1

According to 'kate --help', to open a file and jump to a certain line, you have to use the '-l' argument, instead of '+':

kate -l LINE FILE.c

Works for me (command line, not cscope).

f15h

Posted 2014-12-26T14:45:53.843

Reputation: 121