Noeud:configuring an editor, Noeud « Next »:, Noeud « Previous »:acquiring and installing, Noeud « Up »:cscope



configuring an editor

CSCOPE displays a menu of search commands. You fill in the search field for one of these commands, and then CSCOPE displays a menu of files and lines that match the criteria. When you pick from this latter menu, CSCOPE tries to fire up your editor or viewer of choice to display the text at the indicated line. It tries to use an environment variable to determine which to use. In order of preference:

CSCOPE_EDITOR The preferred choice
VIEWER read-only access implied
EDITOR common environment variable for showing preference
vi the viewer used if none are selected as above

A special choice for CSCOPE is actually a good idea. It is very convenient to be able to access the CSCOPE menu while viewing previous results in alternate windows. If you use emacs, this can be accomplished by starting the server process in your main emacs editing session and setting your editor to EMACSCLIENT. You can accomplish a similar functionality with VI by writing a small wrapper script and specifying it as your editor:

     #! /bin/sh
     xterm -e /bin/vi $ &
     

Now, your cscope session will remain active concurrently with your viewer sessions. Be sure to put this shell script in a directory named in the $PATH environment variable and be sure also to make the script executable by typing: chmod a+x script-name.