Emacs + Rope + Python会产生lisp错误

时间:2012-02-01 23:36:00

标签: python emacs autocomplete ropemacs rope

我正在尝试在Emacs中使用Ropemacs和AutoComplete,但我一直收到调试器错误:

Debugger entered--Lisp error: (void-function rope-completions)
  (rope-completions)
  eval((rope-completions))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

符号rope-completions没有来自C-h S的文档。它只出现在auto-complete-config中一次。我已经下载了最新的ropemacs,ropemode,pymacs,python-rope,并且可能使我的系统具有一致性。

当我从配置文件中删除此功能时,auto-complete在尝试完成时将光标变为红色。我无法在我的系统上找到对此功能的引用。

在Lisp中,Auto-complete对我来说非常合适。如何让自动完成和Rope一起工作,让我在Emacs中自动完成Python?

编辑:我无法通过C-h f看到绳索完成的定义。这是我的Pymacs缓冲区的输出:

<23 (version "0.24-beta2")
>45 eval pymacs_load_helper("ropemacs", "rope-")
<278    (return '(progn (pymacs-defuns '(0 rope--OldProgress nil 1 rope--LispProgress nil 2 rope-LispUtils nil 3 rope-message nil 4 rope--lisp-name nil 5 rope--load-ropemacs nil 6 rope--started-from-pymacs nil 7 rope-occurrences-goto "" 8 rope-occurrences-next "")) (pymacs-python 9)))
>45 eval pymacs_load_helper("ropemacs", "rope-")
<288    (return '(progn (pymacs-defuns '(10 rope--OldProgress nil 11 rope--LispProgress nil 12 rope-LispUtils nil 13 rope-message nil 14 rope--lisp-name nil 15 rope--load-ropemacs nil 16 rope--started-from-pymacs nil 17 rope-occurrences-goto "" 18 rope-occurrences-next "")) (pymacs-python 19)))
>51 eval free_python(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19)
<13 (return nil)
>45 eval pymacs_load_helper("ropemacs", "rope-")
<279    (return '(progn (pymacs-defuns '(19 rope--OldProgress nil 9 rope--LispProgress nil 8 rope-LispUtils nil 7 rope-message nil 6 rope--lisp-name nil 5 rope--load-ropemacs nil 4 rope--started-from-pymacs nil 3 rope-occurrences-goto "" 2 rope-occurrences-next "")) (pymacs-python 1)))

2 个答案:

答案 0 :(得分:4)

你的emacs设置中有这样的东西吗? (另见:agr / ropemacs / overview — Bitbucket

(require 'pymacs)
(pymacs-load "ropemacs" "rope-")

如果有,请检查您是否有rope-open-projectC-x p o)等ropemacs命令。

请注意rope-completions被定义为python函数,因此您不会在elisp源代码中看到它的定义。

如果你正确加载ropemacs,当你点击C-h f rope-completions RET(而不是C-h S)时,你会看到这个。

rope-completions is an interactive Lisp function.

(rope-completions &rest ARGUMENTS)

It interfaces to a Python function.

答案 1 :(得分:1)

我最终能够做到的唯一方法是忽略所有其他教程,只使用Emacs For Python Github。它工作得很好,结合了我想要使用的很多软件包,并且很容易配置,因此它不会弄乱我现有的绑定和设置。