Pymacs0.25手册在Section 3.4.2中有以下代码片段
(pymacs-exec "import re")
(setq matcher (pymacs-eval "re.compile('PATTERN').match"))
(pymacs-call matcher "PATTERN123")在运行Python 2.7.3的Ubuntu 12.04 (32位)上的Emacs24.2中,前两条语句执行正常,但第三条语句抛出以下错误:
pymacs-report-error: Python: Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Pymacs.py", line 268, in loop
value = eval(text)
File "<string>", line 1
(lambda (&rest arguments) (pymacs-apply (quote (pymacs-python . 5)) arguments))(".")我不太了解Elisp,但是lambda语句本身使用C-x C-e计算时没有任何错误,所以我不知道哪里出了问题。另外,看看Pymacs.py,它看起来像是在尝试直接计算elisp代码。请帮帮忙?
发布于 2013-02-18 13:27:22
由于pymacs-call语句返回一个lambda函数,因此使用(funcall matcher "PATTERN123")调用它的工作方式与预期的一样。手册中的示例代码可能是错误的。
https://stackoverflow.com/questions/14920436
复制相似问题