我尝试使用emacs制作PythonIDE,就像这篇文章中所述http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/。但是emacs告诉我“auto-complete-mode未启用”。是否可以使用emacs进行Python编码?
我尝试使用emacs制作PythonIDE,就像这篇文章中所述http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/。但是emacs告诉我“auto-complete-mode未启用”。是否可以使用emacs进行Python编码?
every time you open python files, by adding the following to your .emacs
:
(add-hook 'python-mode-hook
(lambda ()
(auto-complete-mode 1)))
or when you open any file, by adding the following to your .emacs
:
(global-auto-complete-mode t)
您所链接的问题提出了更加完整的方案(即包含我建议的前两个方案中的第一个):
(add-hook 'python-mode-hook
(lambda ()
(auto-complete-mode 1)
(set (make-local-variable 'ac-sources)
(append ac-sources '(ac-source-rope) '(ac-source-yasnippet)))
(set (make-local-variable 'ac-find-function) 'ac-python-find)
(set (make-local-variable 'ac-candidate-function) 'ac-python-candidate)
(set (make-local-variable 'ac-auto-start) nil)))
使用代码片段和Rope,需要添加这些内容才能完全完成。