Adapt bash readline operate-and-get-next

Lele Gaifax lele at metapensiero.it
Mon Aug 18 14:49:13 EDT 2014


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:

> On Mon, 21 Jul 2014 17:57:22 +0200, Lele Gaifax wrote:
>> Granted, the readline library exposes a "operate-and-get-next" function,
>> by default bound to \C-o...
>
> Have you actually got that working in Python with the readline module? 
> I've tried and tried and cannot get it to work. Any hints gratefully 
> appreciated.

This is just a first attempt to adapt the Bash code to the Python
readline.c module: I'm very surprised that the half-an-hour I spent on
it, mostly to locate related code, actually full filled the goal :-)

The patch isn't complete, in particular, it does not work on Apple's
libedit, because I have no way to try it on that system. Also, I'm not
fluent with Mercurial, so this is just a "hg diff".

Even if I know this is not the right forum and I should (and I
eventually do, assuming a positive feedback) instead open a ticket and
attach the patch there, I'd like to hear opinions on whether this should
be enabled by default, and possibly get in touch with some Apple
owner...

ciao, lele.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readline.patch
Type: text/x-diff
Size: 2642 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20140818/1cf3986d/attachment.patch>
-------------- next part --------------

-- 
nickname: Lele Gaifax | Quando vivr? di quello che ho pensato ieri
real: Emanuele Gaifas | comincer? ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.


More information about the Python-list mailing list