在emacs中安装自动完成

时间:2014-11-08 20:22:50

标签: emacs

我是Emacs的新手,我下载了自动完成,将其移至〜/ .emacs.d / plugins /然后将.emacs文件修改为:

(add-to-list 'load-path (file-name-as-directory
                     (expand-file-name "~/.emacs.d/plugins/auto-complete"))\
)

(require 'auto-complete)
(global-auto-complete-mode t)

(ac-config-default)
(custom-set-variables
;; custom-set-variables was added by Custom.                                   
;; If you edit it by hand, you could mess it up, so be careful.                
;; Your init file should contain only one such instance.                       
;; If there is more than one, they won't work right.                           
'(menu-bar-mode nil)
'(package-archives (quote (("melpa" . "http://stable.melpa.org/packages/") ("g\
nu" . "http://elpa.gnu.org/packages/")))))
(custom-set-faces
;; custom-set-faces was added by Custom.                                       
;; If you edit it by hand, you could mess it up, so be careful.                
;; Your init file should contain only one such instance.                       
;; If there is more than one, they won't work right.                           
)

当我重新启动emacs时,它会显示以下错误:

Warning (initialization): An error occurred while loading `/Users/zeaksilva/.emacs':

File error: Cannot open load file, auto-complete

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.

1 个答案:

答案 0 :(得分:0)

(setq debug-on-error t)放在init文件的开头。或者更好的是,将--debug-init附加到用于调用Emacs的命令行。这将在发生错误时打开调试器。但似乎其中包含(provide 'autocomplete)的文件或该文件的目录不在您的load-path中。调试器打开后,使用C-h v load-path,看看它是否正确。

尝试在init文件中注释掉所有额外的内容,这似乎与此问题无关:custom-set-variablescustom-set-faces。 IOW,简化您尝试调试的东西。