2010-08-10 80 views
12

我最近为OS X 10.6构建并安装了Emacs 23.2.1,显然它预装了CEDET 1.0pre7,但是我的旧CEDET配置失败(例如(semantic-load-excessive-code-helpers)甚至(semantic-load-code-helpers)都是未定义)即使添加了以下我的.emacs后:为GNU Emacs配置CEDET 23.2.1

(require 'cedet) 
(semantic-mode 1) 
(require 'semantic) 

我缺少什么?

回答

17

Emacs集成的CEDET配置是不同的。这是如何适应我的旧配置,未经测试与附加CEDET:

(setq integrated-cedet-p (and (>= emacs-major-version 23) 
           (>= emacs-minor-version 2))) 

(unless integrated-cedet-p 
    (progn 
    (setq cedet-lib "/path/foo") 
    (setq cedet-info-dir "/path/bar"))) 

(if (boundp 'cedet-info-dir) 
    (add-to-list 'Info-default-directory-list cedet-info-dir)) 

(if (boundp 'cedet-lib) 
    (load-file cedet-lib)) 

(semantic-mode 1) 

(global-ede-mode t) 

(if (boundp 'semantic-load-enable-excessive-code-helpers) 
    ; Add-on CEDET 
    (progn 
     (semantic-load-enable-excessive-code-helpers) 
     ; TODO: should already be enabled by previous line 
     (global-semantic-idle-completions-mode) 
     (global-semantic-tag-folding-mode)) 
    ; Integrated CEDET 
    (setq semantic-default-submodes 
     '(global-semanticdb-minor-mode 
      global-semantic-idle-scheduler-mode 
      global-semantic-idle-summary-mode 
      global-semantic-idle-completions-mode 
      global-semantic-decoration-mode 
      global-semantic-highlight-func-mode 
      global-semantic-stickyfunc-mode))) 

(if (boundp 'semantic-ia) (require 'semantic-ia)) 
(if (boundp 'semantic-gcc) (require 'semantic-gcc)) 
+0

愚蠢的是,集成测试-P当然是Emacs 24.1错误。无论如何,你明白了:) – 2010-08-10 11:55:12

+0

正是我需要的,谢谢!你怎么知道这样做?它是否记录在某处我错过了? – 2010-08-10 15:05:30

+0

我在CEDET上使用了Emacs文档章节,并做了一些源浏览以确保未定义的符号语义gcc被折叠成CEDET核心,因此不是必需的。 – 2010-08-11 02:08:53