Pymacs 0.2 for testing!

François Pinard pinard at iro.umontreal.ca
Mon Sep 10 09:26:29 EDT 2001


[Carey Evans]

> Great toy!  [...] All in all, this is very impressive.  I'd looked at
> embedding Python in XEmacs, or writing Python in Emacs Lisp a bit like
> like Jython (!), but the much simpler scheme of using a separate process
> like this never occurred to me.

Thanks for the appreciation!  The idea of a separate process really comes
from Cedric Adjih.  Some of the most impressive features, like for handling
unnamed Python functions on the LISP side, are from Brian McErlean.

> (The reimplementation in Lisp still has some appeal to me, but I don't
> think there's enough time in this life.)

For one, I wanted Python scripting so much that I even considered tackling
solutions even more huge, and which I would not dare spelling here :-).
This is why that little Pymacs project makes me so happy: it gives me what
I much wanted for some time now, at an extremely low price, work-wise.

> I've been playing with Pymacs under XEmacs 21.4 a bit, and I've come
> up with a just a few problems so far.

I got a few others glitches as well, so I might issue another pretest soon.

> -	pymacs-gc-timer (run-at-time t 20 'pymacs-schedule-gc)))
> +	pymacs-gc-timer (run-at-time 20 20 'pymacs-schedule-gc)))

Committed, thanks!  I received a note this morning from Gerd Möllman,
the maintainer of Emacs, offering a patch for the next Emacs release
(or the one after that) installing `post-gc-hook', so Pymacs could work
better, and without a timer.  Since XEmacs has `post-gc-hook' already,
maybe should Pymacs use it automatically if available?  Hmph, yes: done!

By the way, I noticed that Emacs 20.* has hash tables, yet not weak ones.
Pymacs does not crash creating the table, but the table does not fill its
role.  The consequence is that, with older Emacses, memory will silently
leak on both Emacs and Python sides.  This is without serious consequences,
if users are careful to not often transmit complex Pythons objects to Emacs.
I'll add a note to the documentation.

> The second problem is an error from Python with:
>     (pymacs-eval "()")

You are right.  I did your patch a bit differently, forcing `nil' in this
case.  This is natural: I have another special case here for `(quote EXPR)'.

I'll postpone a bit your other remarks, they require more thinking on me.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list