简体   繁体   English

在emacs中安装自动完成

[英]Installing auto-complete in emacs

I am a new to Emacs , i downloaded auto-complete , moved it to ~/.emacs.d/plugins/ then modified the .emacs file to look like : 我是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.                           
)

when i restart emacs , it displays the following error : 当我重新启动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.

Put (setq debug-on-error t) at the beginning of your init file. (setq debug-on-error t)放在初始化文件的开头。 Or better yet, append --debug-init to the command line you use to invoke Emacs. 或者更好的是,将--debug-init附加到用于调用Emacs的命令行中。 That will open the debugger when the error occurs. 发生错误时,这将打开调试器。 But it seems that the file that has (provide 'autocomplete) in it, or that file's directory, is not in your load-path . 但是似乎其中包含(provide 'autocomplete)文件或该文件的目录不在您的load-path When the debugger opens, use Ch v load-path , and see whether it is correct. 打开调试器后,使用Ch v load-path ,查看它是否正确。

And try commenting out all of the extra stuff in your init file, which does not seem related to this problem: the custom-set-variables and custom-set-faces . 并尝试注释掉init文件中似乎与该问题无关的所有其他内容: custom-set-variablescustom-set-faces IOW, simplify the sack of stuff that you try to debug. IOW,简化您尝试调试的工作流程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM