mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Separate readline initialization into new function PyOS_ReadlineInit().
For Dave Ascher's readline extensions.
This commit is contained in:
parent
d17057745c
commit
adf876938a
1 changed files with 14 additions and 7 deletions
|
|
@ -100,6 +100,19 @@ my_fgets(buf, len, fp)
|
||||||
#endif /* WITH_READLINE */
|
#endif /* WITH_READLINE */
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PyOS_ReadlineInit()
|
||||||
|
{
|
||||||
|
static int been_here;
|
||||||
|
if (!been_here) {
|
||||||
|
/* Force rebind of TAB to insert-tab */
|
||||||
|
extern int rl_insert();
|
||||||
|
rl_bind_key('\t', rl_insert);
|
||||||
|
been_here++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
my_readline(prompt)
|
my_readline(prompt)
|
||||||
char *prompt;
|
char *prompt;
|
||||||
|
|
@ -108,13 +121,7 @@ my_readline(prompt)
|
||||||
char *p;
|
char *p;
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
RETSIGTYPE (*old_inthandler)();
|
RETSIGTYPE (*old_inthandler)();
|
||||||
static int been_here;
|
PyOS_ReadlineInit();
|
||||||
if (!been_here) {
|
|
||||||
/* Force rebind of TAB to insert-tab */
|
|
||||||
extern int rl_insert();
|
|
||||||
rl_bind_key('\t', rl_insert);
|
|
||||||
been_here++;
|
|
||||||
}
|
|
||||||
old_inthandler = signal(SIGINT, onintr);
|
old_inthandler = signal(SIGINT, onintr);
|
||||||
if (setjmp(jbuf)) {
|
if (setjmp(jbuf)) {
|
||||||
#ifdef HAVE_SIGRELSE
|
#ifdef HAVE_SIGRELSE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue