[Patches] [ python-Patches-558432 ] Prevent Annoying ' ' from readline

noreply@sourceforge.net noreply@sourceforge.net
Thu, 30 May 2002 08:42:26 -0700


Patches item #558432, was opened at 2002-05-20 16:33
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=558432&group_id=5470

Category: Modules
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Holger P. Krekel (dannu)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Prevent Annoying ' ' from readline

Initial Comment:
readline in all python versions is configured
to append a 'space' character for a successful
completion. But for almost all python expressions
'space' is not wanted (see coding conventions PEP 8).
For example if you have a function 'longfunction'
and you type 'longf<TAB>' you get 'longfunction '
as a completion. note the unwanted space at the 
end. 

The patch fixes this behaviour by setting readline's
append_character to '\0' which means don't append
anything. This doesn't work with readline < 2.1
(AFAIK nowadays readline2.2 is in good use).

An alternative approach would be to make the
append_character
accessable from python so that modules like
the rlcompleter.py can set it to '\0'. 

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-05-30 11:42

Message:
Logged In: YES 
user_id=6380

Thanks! Checked in. If you want to pursue the alternative,
please supply a (new) patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=558432&group_id=5470