我正在尝试在 Emacs 中使用带有自动完成功能的 Ropemacs,但我一直收到调试器错误:
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 的文档。它只出现一次,在自动完成配置中。我已经下载了最新的 ropemacs、ropemode、pymacs、python-rope 并且可能已经厌倦了我拥有的任何 apt 系统一致性。
当我从配置文件中删除此功能时,自动完成功能会在尝试完成时将光标变为红色。我在我的系统上的任何地方都找不到对这个函数的引用。
自动完成在 Lisp 中对我来说工作得很好。我怎样才能让自动完成和 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)))
最佳答案
您的 emacs 设置中有这样的东西吗? (另请参阅:agr / ropemacs / overview — Bitbucket )
(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
如果有,请检查是否有 ropemacs 命令,例如 rope-open-project
(C-x p o
)。
请注意,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.
关于python - Emacs + Rope + Python 产生 lisp 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9105050/