RELEASED: Pymacs 0.19
14 Nov 2002 10:18:33 -0500
Hello, my friends.
It has been a long time since the last Pymacs bug! Here is a new release.
* One may now correctly iterate overs Emacs Lisp lists from Python using a
short `for' form. Just for illustrating Pymacs to newcomers, here is a
simple, but complete example. Once Pymacs installed, and after putting
the following file as `essai.py' somewhere on on the Python search path:
from Pymacs import lisp
for element in list:
lisp.message('%s' % element)
the following commands given within in Emacs:
M-x pymacs-load RET essai RET RET
M-: (essai-essai '(a b c d)) RET
will append five lines "'a", "'b", "'c", "'d" and "nil" to the Emacs
`*Messages*' buffer. The last "nil" is merely the return value of the
Python `essai' function.
* On the Emacs side, the function `(pymacs-call FUNCTION ARGUMENT...)' is
added for convenience. It works like `pymacs-apply', except that
arguments are given separately instead of bundled into a single list.
* The documentation has been slightly revised towards Python 2 times.
For specifying the Emacs interactive behaviour of Python functions, it
suggests that we prefer function attributes over a global dictionary,
unless there is a real portability concern for older Python versions.
Pymacs is a powerful tool which, once started from Emacs, allows both-way
communication between Emacs Lisp and Python. Yet, Pymacs aims Python as
an extension language for Emacs rather than the other way around; this
assymetry is reflected in some design choices. Within Emacs Lisp code,
one may load and use Python modules. Python functions may themselves
use Emacs services, and handle Emacs Lisp objects kept in Emacs Lisp space.
`http://www.iro.umontreal.ca/~pinard/pymacs/' contains a copy of the
Pymacs documentation in HTML form. The canonical Pymacs distribution is
available as `http://www.iro.umontreal.ca/~pinard/pymacs/Pymacs.tar.gz'.
Report problems and suggestions to `mailto:firstname.lastname@example.org'.
François Pinard http://www.iro.umontreal.ca/~pinard