我使用emacs语义来自动完成C语言结构,但是当我标记">" (Message->)它显示错误"无法分析语义不支持的缓冲区"。
谷歌多次,我找不到任何解决方案。
调试消息:
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 :(得分:0)
你正在使用一个可怕的过时的CEDET。 只需更新到最新的Emacs,或至少更新到24.3。 然后你可以使用零配置进行测试:
emacs24.3 -Q ~/test.c
M-x semantic-mode
。在此之后,semantic-ia-complete-symbol
将提出
适当的弹出窗口。