Wednesday, April 7, 2010

Emacs + Cscope

To Install in Debian/Ubuntu

sudo apt-get install cscope

write this 2 lines in you .emacs
...
(load-file "/usr/share/emacs/site-lisp/xcscope.el")
(require 'xcscope)
...

Then, if you have code in ~/mycode, cd to that directory and run
Code:
myusernam@mycomputer:~/mycode$ cscope-indexer -r

run emacs

myusernam@mycomputer:~/mycode$ emacs main.c

put the cursor on the word you want to search and

alt+x (and one of the the options bellow)
cscope-find-called-functions
cscope-find-egrep-pattern
cscope-find-files-including-file
cscope-find-functions-calling-this-function
cscope-find-global-definition
cscope-find-global-definition-no-prompting
cscope-find-this-file
cscope-find-this-symbol
cscope-find-this-text-string

No comments:

Blog Archive