[Patches] [ python-Patches-558430 ] Prevent annoying space from readline

noreply@sourceforge.net noreply@sourceforge.net
Mon, 20 May 2002 13:35:07 -0700


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

Category: Modules
Group: Python 2.3
>Status: Deleted
Resolution: None
Priority: 5
Submitted By: Holger P. Krekel (dannu)
Assigned to: Nobody/Anonymous (nobody)
Summary: Prevent annoying space from readline

Initial Comment:
readline in all python versions is configured
to append a 'space' character for a successful
completion. More precisely the append character
is not configured and that's why readline uses
its default. 

For almost all python expressions
'space' is not wanted (see coding conventions e.g. 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). Otherwise it
works fine with the usual completers in python and
InteractivePython. 

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'. 

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

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