我在Emacs的自動完成軟件包中遇到問題。目前,我已經運行cedet並進行了適當的自動完成,但自動完成軟件包有一些奇怪的行爲。它不使用語義(參議員?)數據庫,直到我明確地訪問包含文件並製作「C-u M-x bovinate」。然後,我可以返回到源文件,自動完成的完成列表將看起來完全符合語義。另一點是如果我編輯我的源文件,例如,在C++模式下,並嘗試在c模式下「bovinate」標題,自動完成將不會在它的完成列表中獲得任何額外的點。設置自動完成以使用語義
任何想法如何自動完成自動完成工作?
我的.emacs文件(其主體部分是從Alex Ott's article拍攝)
(load "~/.emacs.d/cedet/cedet-devel-load.el")
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)
(add-to-list 'semantic-default-submodes 'global-cedet-m3-minor-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-local-symbol-highlight-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode)
(require 'semantic/ia)
(semantic-mode 1)
(require 'semantic/bovine/gcc)
(semantic-add-system-include "/usr/include/mpi/" 'c++-mode)
;; ;; Imenu integration
(defun my-semantic-hook()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
;; Class suggest improvement
(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)
;;;; Semantic and auto-config integration
(require 'auto-complete-config)
(ac-config-default)
(add-to-list 'ac-dictionary-directories "/home/zvord/.emacs.d/ac-dict")
(define-key ac-mode-map [(meta return)] 'auto-complete)
(defun my-cedet-hook()
(add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'my-cedet-hook)
從所有我讀過這應該是足以讓自動完成工作,但事實並非如此。