Author zvezdan
Recipients zvezdan
Date 2009-09-10.12:38:26
SpamBayes Score 5.84599e-09
Marked as misclassified No
Message-id <1252586309.61.0.470595753955.issue6877@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch enables compilation and use of the readline module on 
Mac OS X 10.5 (Leopard) and 10.6 (Snow Leopard).
It utilizes the native editline library (used for emulation of the 
readline library on Mac).

I used the patch for almost two years already with Python 2.4 and since 
December 2008 with Python 2.6.  The only difference is that Python 2.4 
did not need the setup.py changes.

The patch is written in such a way that it does *not* affect the 
compilation on systems that use GNU readline library (e.g., Linux).
However, I don't have access to any other system that uses editline 
emulation of readline library besides Mac.  I believe it should work the 
same but some testing would be welcome if anyone is aware of such a 
system (NetBSD?).

With the readline module compiled in, it is enough to put in .editrc

    python:bind -v

and one gets a vi emulation in the python interactive interpreter.

You can also try it directly from the shell:

    >>> import readline
    >>> readline.parse_and_bind("bind -v")
    >>> # use editing features to change the lines above to
    >>> import rlcompleter
    >>> readline.parse_and_bind("bind ^I rl_complete")
    >>> # now TAB offers the completions

It would be nice if we could get this included into Python-2.6.3 
release.
History
Date User Action Args
2009-09-10 12:38:29zvezdansetrecipients: + zvezdan
2009-09-10 12:38:29zvezdansetmessageid: <1252586309.61.0.470595753955.issue6877@psf.upfronthosting.co.za>
2009-09-10 12:38:28zvezdanlinkissue6877 messages
2009-09-10 12:38:27zvezdancreate