【问题标题】:Symbol's function definition is void: global-auto-complete-modeSymbol的函数定义为void:global-auto-complete-mode
【发布时间】:2014-11-18 09:41:36
【问题描述】:

我正在使用 GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0) 我从 Melpa 安装了自动完成功能,并在 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,它会打开自动完成。

这有什么问题?

【问题讨论】:

    标签: emacs autocomplete undefined-symbol


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      • 1970-01-01
      • 2020-11-16
      相关资源
      最近更新 更多