2014-11-21 57 views
0

我使用emacs語義來自動完成C語言結構,但當我標記「>」(Message->)時,它顯示錯誤「無法分析不受語義支持的緩衝區」。Emacs語義自動完成顯示錯誤?

谷歌很多次,我沒有找到任何解決方案。

調試消息:

Debugger entered--Lisp error: (error "Cannot analyze buffers not supported by Semantic") 
signal(error ("Cannot analyze buffers not supported by Semantic")) 
error("Cannot analyze buffers not supported by Semantic") 
semantic-analyze-current-context() 
byte-code("\301 \210^H\203^V^@\302 \204^Q^@\303 \203^V^@\304^H\305\"\210\306\207" [semantic-current-input-throw-symbol semantic-analyze-current-c$ 
byte-code("\212\302\211^X\303\215)?\205^X^@ \304U\205^X^@\302\211^X\305\215)?)\207" [semantic-current-input-throw-symbol arg csi (byte-code "\3$ 
semantic-complete-self-insert(1) 
call-interactively(semantic-complete-self-insert nil nil) 

版本:

CEDET Version: 1.1 
Requested File Loaded 
Package Version Version Version 
---------------------------------------------------------- 
cedet: 1.1 ok ok 
eieio: 1.4 ok ok 
semantic: 2.1 ok ok 
srecode: 1.1 ok ok 
ede: 1.1 ok ok 
speedbar: 1.0.4 ok ok 
cogre: 1.1 ok Not Loaded 
cedet-contrib: 1.1 ok Not Loaded 

的.emacs設置

(add-to-list 'load-path' "~/.emacs.d/company-mode" 
"~/.emacs.d/cedet/common") 
(load "~/.emacs.d/cedet/common/cedet" nil t) 
(autoload 'company-mode "company" nil t) 
(setq company-idle-delay t) 
(global-ede-mode 1) 
(semantic-load-enable-code-helpers) 
(global-srecode-minor-mode 1) 

(add-to-list 'load-path 
     "~/.emacs.d/plugins") 
(require 'yasnippet-bundle) 



;;; semantic setup 
;; (semantic-load-enable-minimum-features) 
;; (semantic-load-enable-code-helpers) 
;; (semantic-load-enable-gaudy-code-helpers) 
(semantic-load-enable-excessive-code-helpers) 
(semantic-load-enable-semantic-debugging-helpers) 

(require 'eieio-opt) 
;;; gcc setup 
(require 'semantic-gcc) 

;;; smart complitions setup 
(require 'semantic-ia) 

;;; 
(defun my-cedet-hook() 
    (local-set-key [(control return)] 'semantic-ia-complete-symbol) 

    (local-set-key "\C-c?" 'semantic-ia-complete-symbol-menu) 
    (local-set-key (kbd "M-n") 'semantic-ia-complete-symbol-menu) 

    (local-set-key "\C-c>" 'semantic-complete-analyze-inline) 
    (local-set-key (kbd "M-/") 'semantic-complete-analyze-inline) 

    (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) 
    (local-set-key "\C-cd" 'semantic-ia-fast-jump) 
    (local-set-key "\C-cr" 'semantic-symref-symbol) 
    (local-set-key "\C-cR" 'semantic-symref) 

    ;;; c/c++ setting 
    (local-set-key "." 'semantic-complete-self-insert) 
    (local-set-key ">" 'semantic-complete-self-insert)) 
(add-hook 'c-mode-common-hook 'my-cedet-hook) 

謝謝!

回答

0

您正在使用可怕的過時CEDET。 只需更新到最新的Emacs,或至少到24.3。 然後你可以用零配置進行測試:

emacs24.3 -Q ~/test.c 

M-Xsemantic-mode。之後,semantic-ia-complete-symbol將彈出 相應的彈出窗口。

+0

謝謝,它的工作。 – 2014-11-24 01:58:04