0

I installed cscope 15.7a, and my .emacs setting like:

;;cscope
(require 'xcscope)
(add-hook 'java-mode-common-hook '(lambda()(require 'xcscope)))

I can use cscope when opening C/C++ code files; and there is a cscope menu above the emacs menu bar, while it don't have when opening java code, so that I can't use cscope to navigate java codes in emacs.

what should I do to use cscope navigating java codes in emacs?

Maybe it's a silly question, sorry for this. I hope someone can help.

gladman
  • 1,208
  • 4
  • 19
  • 39

2 Answers2

0

3 steps to use cscope for java in emacs:

  1. find . -name "*.java" > cscope.files
  2. add java in cscope-indexer file ie change |cc|hh)$ to |cc|hh|java)$
  3. add a hook as gladman mentioned: (add-hook 'java-mode-hook (function cscope:hook))
Kathir
  • 1
  • 1
0

For emacs 25 and xcscope 1.3, you can add a hook in the .emacs file or .emacs.d/init.el like this:

(add-hook 'java-mode-hook (function cscope-minor-mode))