readline clear buffer

Alex Martelli aleax at aleax.it
Sat Apr 12 11:16:35 EDT 2003


Skip Montanaro wrote:

>     Alex> Right: it seems that Python's readline.c does not expose
>     Alex> interfaces to rl_delete_text, rl_kill_text, or other GNU
>     Readline Alex> functions that would allow such behavior.
> 
> GNU readline has a huge API (I count over 340 extern declarations in
> readline/{readline.h,history.h}, the two programmer-visible #include
> files). I believe the approach all along has been to expose just those
> parts of the
> API necessary for the current task at hand.  I realize this means the
> interface will be incomplete, but it's not clear that most of it is
> necessary for common tasks.  So, yes, submit a patch which includes
> wrappers for the functions you're interested in.

I think that's a rather sensible pragmatical approach to finding the
right subset to expose out of a huge API (though proponents of the
"waterfall", AKA "big design up front", sect, are no doubt loading up
their flamethrowers -- if any lurk on c.l.py, that is;-).  And I
notice with pleasure that the OP is now testing out the small patch
to expose text-deletion and plans to submit it, so the incremental
approach to API exposure seems to be still working fine;-).


Alex





More information about the Python-list mailing list