Pregunta

The Pymacs 0.25 manual has the following snippet in Section 3.4.2

(pymacs-exec "import re")
(setq matcher (pymacs-eval "re.compile('PATTERN').match"))
(pymacs-call matcher "PATTERN123")

In Emacs24.2 on Ubuntu 12.04 (32-bit) with Python 2.7.3, the first two statements execute fine, but the third one throws the following error:

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))(".")

I don't know a lot of Elisp, but the lambda statement itself evaluates without any errors with C-x C-e, so I don't know what's going wrong. Also, looking at Pymacs.py, it looks like the code is trying to directly eval elisp code. Please help?

¿Fue útil?

Solución

Since the pymacs-call statement returns a lambda function, calling it with (funcall matcher "PATTERN123") works as expected. It's possible that the sample code in the manual might be wrong.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top