all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs + cscope (xcscope.el)
@ 2007-10-11 17:52 Iakie
  2007-10-11 20:33 ` Thorsten Bonow
  0 siblings, 1 reply; 3+ messages in thread
From: Iakie @ 2007-10-11 17:52 UTC (permalink / raw
  To: help-gnu-emacs

Hi there:

Can anyone give me some tips on using cscope and emacs?

I was able to load xcscope.el from cscope package. However, whenever i
tries to use it, it says it finds nothing.

I edited my .emacs like this:
Code:

(load-file "/usr/share/emacs/site-lisp/xcscope.el")
(require 'xcscope)

Then, I untar-ed linux kernel in my home folder, under which I ran
cscope to generate search database. And I tried to edit some files

Code:

me@box:~/linux-source-2.6.22$ cscope -R -q -b
me@box:~/linux-source-2.6.22$ emacs kernel/time.c

When I tried to find symbol definition using C-c s d, it returns no
matched result

Code:

Finding symbol: tv_nsec

Database directory: /home/me/linux-source-2.6.22/
-------------------------------------------------------------------------------
cscope: no source files found

-------------------------------------------------------------------------------

Search complete.  Search time = 0.01 seconds.

Can someone tell me what I did wrong?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs + cscope (xcscope.el)
  2007-10-11 17:52 Emacs + cscope (xcscope.el) Iakie
@ 2007-10-11 20:33 ` Thorsten Bonow
  2007-10-12 17:41   ` Richard G Riley
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Bonow @ 2007-10-11 20:33 UTC (permalink / raw
  To: help-gnu-emacs

>>>>> "Iakie" == Iakie  <accelas@gmail.com> writes:

Hi,

    Iakie> I edited my .emacs like this: Code:

    Iakie> (load-file "/usr/share/emacs/site-lisp/xcscope.el") (require
    Iakie> 'xcscope)

you should take a look at the installation instructions at the beginning of the
file. In your case, since you put "xcscope.el" in "/usr/share/emacs/site-lisp/",
the

        (require 'xcscope)

should be enough. The directory should be in your `load-path', where emacs looks
for lisp files (you can check with "C-h v load-path")

You missed the part where you should install the indexer-script. I would do this
and try everything from within emacs---it is supposed to work.

    Iakie> Then, I untar-ed linux kernel in my home folder, under which I ran
    Iakie> cscope to generate search database. And I tried to edit some files

    Iakie> Code:

    Iakie> me@box:~/linux-source-2.6.22$ cscope -R -q -b
    Iakie> me@box:~/linux-source-2.6.22$ emacs kernel/time.c

You must specify the initial directory in the cscope menu, but even then this
will fail...

    Iakie> When I tried to find symbol definition using C-c s d, it returns no
    Iakie> matched result

... yup, same here. Works if you let xcscope create the index. Again, you must
install the cscope-indexer script *first*.

    Iakie> Can someone tell me what I did wrong?

This is a FAQ, happens all the time when people try to call cscope manually and
then make xcscope.el work with the manually created database. The problem arises
because xcscope.el expects a database created with a file list and not by a call
with recursion turned on.

xcscope.el fails too when you specify the "-k" switch for "kernel mode" (as you
should have done)" So in your case you should let cscope-indexer do the job from
within emacs and xcscope.el.

For ages I'm thinking of modifying xcscope.el so that it calls cscope directly
(this would make it possible to use it under Windoze without having a bash shell
for calling the indexer script installed).

Haven't gotten around to it yet. Someone out there to beat me to it?

Hope this helps.

Toto


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

At Tom Baker's wake, quite well attended, as the wakes and
funerals of misunderstood people usually are, I sang `Ride 'em
Jewboy.' The song is a western translation of what is essentially
an eastern experience, the holocaust. It is not surprising that
this song had been a favorite of Bakers's. As Brendan Behan said:
`The Irish and the Jews do not share a nation; they share a
psychosis.'

Kinky Friedman: Elvis, Jesus and Coca-Cola

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Emacs + cscope (xcscope.el)
  2007-10-11 20:33 ` Thorsten Bonow
@ 2007-10-12 17:41   ` Richard G Riley
  0 siblings, 0 replies; 3+ messages in thread
From: Richard G Riley @ 2007-10-12 17:41 UTC (permalink / raw
  To: help-gnu-emacs

Thorsten Bonow <thorsten.bonow@post.rwth-aachen.de> writes:

>>>>>> "Iakie" == Iakie  <accelas@gmail.com> writes:
>
> Hi,
>
>     Iakie> I edited my .emacs like this: Code:
>
>     Iakie> (load-file "/usr/share/emacs/site-lisp/xcscope.el") (require
>     Iakie> 'xcscope)
>
> you should take a look at the installation instructions at the beginning of the
> file. In your case, since you put "xcscope.el" in "/usr/share/emacs/site-lisp/",
> the
>
>         (require 'xcscope)
>
> should be enough. The directory should be in your `load-path', where emacs looks
> for lisp files (you can check with "C-h v load-path")
>
> You missed the part where you should install the indexer-script. I would do this
> and try everything from within emacs---it is supposed to work.
>
>     Iakie> Then, I untar-ed linux kernel in my home folder, under which I ran
>     Iakie> cscope to generate search database. And I tried to edit some files
>
>     Iakie> Code:
>
>     Iakie> me@box:~/linux-source-2.6.22$ cscope -R -q -b
>     Iakie> me@box:~/linux-source-2.6.22$ emacs kernel/time.c
>
> You must specify the initial directory in the cscope menu, but even then this
> will fail...
>
>     Iakie> When I tried to find symbol definition using C-c s d, it returns no
>     Iakie> matched result
>
> ... yup, same here. Works if you let xcscope create the index. Again, you must
> install the cscope-indexer script *first*.
>
>     Iakie> Can someone tell me what I did wrong?


I use two scripts to use tags and cscope in conjunction with the oft
overlooked fact that the linux makefiles include makefiles with tags and
cscope targets : i just run "tags" .....

1) ~/bin/tags

,----
| #!/bin/bash
| cd ~/programming
| echo Calculating tags in ~/programming ...
| ctags-exuberant  -e --language-force=auto --recurse=yes --links=yes ~/programming
| 
| cd /usr/src/linux
| echo Calculating tags in /usr/src
| make TAGS
| 
| ~/bin/makecs
| # echo Done!
`----

2) ~/bin/makecs

,----
| #!/bin/bash
| 
| SRC=/usr/src/linux
| 
| cd $SRC
| echo "CScoping Linux sources ....."
| make cscope
| 
| SRC=/home/rgr/programming
| 
| cd $SRC
| echo "CScoping ~/programming/c....."
| # find -L $SRC -name "*.[chxsS]" -o -iname \*.php -print > cscope.files
| find -L $SRC -name "*.[chxsS]" -print > cscope.files
| cscope -b -q -u
`----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-12 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 17:52 Emacs + cscope (xcscope.el) Iakie
2007-10-11 20:33 ` Thorsten Bonow
2007-10-12 17:41   ` Richard G Riley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.