Configuring Emacs 23.4, CEDET 1.1, and SemanticDB to Use GNU Global on Windows

I am trying to customize my Emacs configuration for Java development. That's pretty good - I work in malabar mode, and GNU Global works to view tags. The only thing I cannot get is to get semanticdb to use gnu global correctly. None of my imports were found.

Firstly, this is a multi-module Maven project with all sources extracted from the top-level root folder. All other projects are below this in the directory tree. There is one GTAGS database in this root folder, covering everything.

Things that work:

  • M-x gtags-find-tag RET symbol RET works great, so the database is good and global can find it.
  • M-x cedet-gnu-global-version-check it works and reports that my version is good.
  • M-x cedet-gnu-global-expand-filename works
  • M-x semanticdb-find-test-translate-path shows the GNU Global Lookup Table when in a Java buffer
  • I have a JDK source folder installed as a system folder, so the main Java requests are handled correctly.

My java configuration is as follows (initializing cedet earlier in the file):

(add-local-load-path "malabar/lisp")

(require 'malabar-mode)
(setq malabar-groovy-lib-dir (concat emacs-local-site-lisp "malabar/lib"))
(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))

;; enable semanticdb support for gnu global
(when (cedet-gnu-global-version-check t)
  (semanticdb-enable-gnu-global-databases 'java-mode))

(add-hook 'java-mode-hook
    (lambda ()
    (gtags-mode 1)))

(add-hook 'java-mode-hook 'flymake-mode-on)

(defun my-java-flymake-init ()
  (list "javac" (list (flymake-init-create-temp-buffer-copy
                   'flymake-create-temp-with-folder-structure))))

(add-to-list 'flymake-allowed-file-name-masks
         '("\\.java$" my-java-flymake-init flymake-simple-cleanup))

(add-hook 'java-mode-hook
      '(lambda ()
         (semantic-add-system-include (getenv "JAVA_HOME") 'java-mode)))
+5
source share
1 answer

The answer is related to how your projects are set up and if you use EDE. EDE - Emacs Development Envornment (an IDE game), and how CEDET keeps track of which files belong to your project. This limiter is associated with both productivity (finding less material) and preventing the configuration of one project bleeding into another.

, Maven CEDET/EDE. , , ede-cpp-root ( ++) . , java.

EDE GNU Global (. GNU Global EDE, Semantic), GTAGS .

-1 -2, GTAGS -1, . GTAGS EDE .

, GTAGS, , , EDE, GTAGS.

cedet-devel , .

+3

All Articles