Could Emacs be rewritten in Python?

Beni Cherniavsky cben at
Fri Apr 18 00:19:08 CEST 2003

In comp.lang.python, you wrote:
>Paul Foley wrote:
>> Don't forget the ~20000 other variables that you'd have to pass around
>> as explicit arguments to *every single function*.
>Paul, you're suffering from an extremely bad case of
>tunnel thinking.
>You wouldn't pass around 20,000 variables. You would
>pass around a very few objects (in most cases probably
>just one, i.e. a buffer) from which everything else you
>need can be gotten to if and when you need it.
It's hard to know which objects you need to pass.  Most commands only touch
the current buffer but some touch the frame configuration, the global
variables and just about anything in emacs.  You would pretty much need to
pass the whole emacs object :-).

Perhaps it's possible to specify the required objects with the interactive
call parameter specification mechanism but tracking that would be non-trivial
when manully doing calls.  Imagine that some function you call from your
command suddenly is changed to sometimes require access to the window
configuration, which it didn't do before.  Now you have to change the call to
it to include this and perhaps change your own signature to include it if you
don't currently.

It's the same issue as capabilities-based security with the "principle of
least authority" - nice idea but painful to track precisely...

Beni Cherniavsky <cben at>

More information about the Python-list mailing list