2014-11-26 8 views
0

저는 emacs에 익숙하지 않아 코드 완성을 위해 cedit를 사용하려고했습니다. 내가 http://alexott.net/en/writings/emacs-devenv/EmacsCedet.htmlemacs cedit C++ 코드 완성이 실패했습니다.

이맥스를 기반으로 간단한 설정을 사용은 다음과 같습니다

;; cedit 
(semantic-mode 1) 
(require 'semantic/ia) 
(require 'semantic/bovine/gcc) 
;;(require 'semantic/bovine/clang) 
;;(semantic-clang-active) 

(setq-mode-local c-mode semanticdb-find-default-throttle 
       '(project unloaded system recursive)) 

;;(semantic-idle-summary-mode) 
;; if you want to enable support for gnu global 
(semanticdb-enable-gnu-global-databases 'c-mode) 
(semanticdb-enable-gnu-global-databases 'c++-mode) 
;;(semantic-reset-system-include 'c-mode) 
;;(semantic-reset-system-include 'c++-mode) 
(defun my-c-mode-cedet-hook() 
(local-set-key "." 'semantic-complete-self-insert) 
(local-set-key ">" 'semantic-complete-self-insert)) 
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) 
(add-hook 'c++-mode-common-hook 'my-c-mode-cedet-hook) 

(defun my-c-mode-cedet-hook() 
    (add-to-list 'ac-sources 'ac-source-gtags) 
    (add-to-list 'ac-sources 'ac-source-semantic) 
    (add-to-list 'ac-sources 'ac-source-semantic-raw)) 
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) 


(global-ede-mode t) 

나는이 간단한 C와 테스트 후 ++ 파일 : 나는 같은 키워드를 완료 할 수 있습니다 발견

#include <string> 
#include <map> 
#include <stdio.h> 
#include <iostream> 

using namespace std; 

int main() { 

    string s; 

    map<int,int>a; 

} 

을 포함 또는 헤더 파일. 내가 s의 메소드를 완료하려고 할 때 실패합니다. 그리고 명령을 사용할 때 semantic-ia-complete-symbol 그냥보고합니다. Cannot find types for string s

아무도 왜 작동하지 않는지 알 수 있습니까? 그리고 대단히 감사합니다!

답변

0

최신 이맥스로 바로 업데이트. 이, 당신의 예는 semantic-ia-complete-symbol, 즉

emacs -Q test.cc 

M-Xsemantic-mode 제로 설정 작동합니다.

+0

나는 이것을 시도했지만 작동하지 않을 것이다. 나는 emacs 24.3.1을 사용하고있다. 이 파일에 클래스를 정의하면 성공적으로 메소드를 완료 할 수 있습니다. – user3008895

+0

http://ftpmirror.gnu.org/emacs/에서 24.4를 얻어야합니다. –