help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cscope


From: Thorsten Bonow
Subject: Re: cscope
Date: Thu, 06 Jan 2005 18:51:41 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Security Through Obscurity, linux)

>>>>> "Ravi" == Ravi Uday <raviuday@gmail.com> writes:

    Ravi> I am using just cscope and dont have xcscope.  Actually the question
    Ravi> is After you have built the cscope files and invoked the emacs21 from
    Ravi> there, what is the process/procedure to load a cscope file into emacs
    Ravi> (may be in .emacs) and set any env/path variables if any

Hi!

Let's do it step by step:

For your Emacs initialisation file:

;;
(add-to-list 'load-path "/directory/where/you/put/your/cscop.el-library")
(require 'cscope)
;;

You can omit the first line if you have put cscope.el into a directory already 
in your
load-path, e.g. a site-lisp directory. Don't forget to byte-compile it for
faster loading and execution...

So now I have put this example C file "test.c" into directory "~/42"

/* test.c */
main () {

}
/* test.c */

Then I can call the cscope program:

~/42 $ cscope ./test.c

That produces a "cscope.out" file. Now if you open your emacs with

~/42 $ emacs ./test.c

You can put the cursor on "main" and call 

M-x cscope-find-c-symbol

cscope.el now proposes to look for "main" (not a very useful example, I know
:-), press return and voila, a buffer opens which tells you that

Find this C symbol: main
cscope: 1 lines
test.c main 1 main () {
>> 

You can get help on other functions in the package by 

C-h f cscope- and then pressing TAB to get the a list of functions in
the package, e.g. 

cscope-find-all
cscope-find-c-symbol
cscope-find-egrep-pattern
cscope-find-file
cscope-find-files-including
cscope-find-functions-called
cscope-find-functions-calling
cscope-find-global-definition
cscope-find-grep-pattern
cscope-find-text-string

But they simple let you get access to cscope functionality from within Emacs...

    Ravi> I am using just cscope and dont have xcscope.

As I have mentioned before: xcscope is normally included in the cscope
package. So very likely you have it. I prefer it to plain cscope.el. But YMMV...

Hope this helps...

Toto


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

Now I have a cat. Well, that's not quite accurate. A cat and I have
each other.

Friedman, Kinky (1993), When the cat's away. New York (Wings Books),
421

reply via email to

[Prev in Thread] Current Thread [Next in Thread]