在emacs中配置自动完成功能?

时间:2014-02-05 11:10:16

标签: emacs autocomplete

我在MELPA的emacs中安装了auto-complete包,我可以使用M-x auto-complete-mode启用它。我在配置方面遇到了一些问题,我已将以下几行添加到.emacs

(add-to-list 'load-path "~/.emacs.d/elpa/auto-complete-20140201.2101")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete-20140201.2101/dict")
(ac-config-default)

当我启动emacs时出现错误

Warning (initialization): An error occurred while loading `/home/user/.emacs':

File error: Cannot open load file, popup

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.

auto-complete需要popup,如果我列出包含M-x list-packages的软件包,则两者都会列为已安装。关于我应该怎么做的任何建议?

1 个答案:

答案 0 :(得分:3)

这样的普通配置应该有效:

(setq package-user-dir "~/.emacs.d/elpa/")
(package-initialize)

无需专门更改load-path