Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate perl code with cscope in emacs?

I have been a VIM user for 4 years, but have been trying to learn emacs. My project is fully written in perl and I am trying to get the cscope working in emacs for perl.

I don't have any problem navigating perl from VIM.“cs add cscope.out” from vim command mode does the job for me. In emacs though, with the same cscope database (which has both C++ and perl symbols) emacs perfectly recognizes my C symbols (M-x M-x cscope-find-global-definition). But for perl symbols, I am getting the below error .

Error: Finding global definition: somePerlFunction Search complete.
Search time = 0.92 seconds. No matches were found.

Does emacs supports perl code navigation? If not, isn't it a major drawback? Can someone please help?

like image 656
rajachan Avatar asked Nov 14 '22 21:11

rajachan


1 Answers

Yes, Emacs supports cscope, there are several options:

http://www.emacswiki.org/emacs/CScopeAndEmacs

I've just tested xcscope.el on GNU Emacs 24 and it seems to be working fine.

If you already have a cscope database, I suggest you run cscope from the command line, using the -d flag:

cscope -d

Use the 'Find this global definition' option to search for your symbol, if you don't get any results then the issue is with cscope, not Emacs. If you do find results, please provide more detail, e.g. which method of integrating cscope with Emacs you are using, which version of Emacs, and provide sample perl code which can be used to reproduce the problem.

You may also want to investigate cedet:

http://cedet.sourceforge.net/

like image 200
Luke Girvin Avatar answered Dec 19 '22 03:12

Luke Girvin