8

我尝试安装 auto-complete 和 auto-complete-clang-async。当我写类似的东西时std::,emacs 说“自动完成未激活”。

我的自动完成配置是:

(require 'auto-complete)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete/dict")
(set-default 'ac-c-sources
         '(ac-source-abbrev
           ac-source-dictionary
           ac-source-yasnippet
           ac-source-words-in-buffer
           ac-source-words-in-same-mode-buffers
           ac-source-semantic))
(ac-config-default)
(dolist (m '(c-mode c++-mode java-mode))
(add-to-list 'ac-modes m))
(global-auto-complete-mode t)

;auto-complete-clang-async
(require 'auto-complete-clang-async)

(defun ac-cc-mode-setup ()
  (setq ac-clang-complete-executable "~/.emacs.d/clang-complete")
  (setq ac-sources '(ac-source-clang-async))
  (ac-clang-launch-completion-process)
)

(defun my-ac-config ()
  (add-hook 'c-mode-common-hook 'ac-cc-mode-setup)
  (add-hook 'auto-complete-mode-hook 'ac-common-setup)
  (global-auto-complete-mode t))
(my-ac-config)

错误是:

auto-complete error: (void-variable ac-source-c)
4

0 回答 0