Symbol的函数定义为void:global-auto-complete-mode

时间:2014-11-18 09:41:36

标签: emacs autocomplete undefined-symbol

我正在使用GNU Emacs 24.4.1(x86_64-apple-darwin14.0.0) 我从Melpa安装了auto-complete,并在init.el中有以下行:

(global-auto-complete-mode 1)

当我打开emacs时,它会发出警告:

Warning (initialization): An error occurred while loading `/Users/lita/.emacs.d/init.elc':

Symbol's function definition is void: global-auto-complete-mode

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

自动完成模式无法启动。在我将init.el中的行更改为:

之后
(eval-after-load 'auto-complete (global-auto-complete-mode 1))

它仍然提出了同样的警告。但如果我'eval-buffer,它会打开自动完成。

那有什么问题?

1 个答案:

答案 0 :(得分:2)

在你的init文件中,你应该在引用包之前调用(package-initialize)

此外,您的eval-after-load声明中有拼写错误。您需要引用表单,否则立即对其进行评估,这就是您收到警告的原因。换句话说:

(eval-after-load 'auto-complete '(global-auto-complete-mode 1))

或者,您可以使用新的宏with-eval-after-load

相关问题