8000 Added editline fix · python/cpython@dc082eb · GitHub
[go: up one dir, main page]

Skip to content

Commit dc082eb

Browse files
committed
Added editline fix
1 parent 3f3691e commit dc082eb

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

Misc/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NEWS News for this release
2525
README The file you're reading now
2626
RFD Request For Discussion about a Python newsgroup
2727
cheatsheet Quick summary of Python by Ken Manheimer
28+
editline-fix A news article on how to fix R$'s editline for Python
2829
fixfuncptrs.sh Shell script to fix function pointer initializers
2930
gMakefile Generic Makefile for dynamically loadable modules
3031
indent.pro GNU indent profile approximating my C style

Misc/editline-fix

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Subject: Problems trying to use readline or editline ...
2+
From: Skip Montanaro <skip@dolphin.automatrix.com>
3+
To: python-list@cwi.nl
4+
Date: 19 Nov 1995 14:19:56 GMT
5+
X-Newsgroups: comp.lang.python
6+
X-Organization: Automatrix, Inc.
7+
8+
9+
I'm having some trouble with either of the line editing libraries available
10+
to me. If I build Python with libreadline, I get "staircases" in my
11+
interpreter output:
12+
13+
>>> s = 1
14+
>>> a = 3
15+
>>> etc.
16+
17+
So I figured I'd give Rich Salz's editline a try. It seems to be missing a
18+
couple readline functions. When I link I get:
19+
20+
myreadline.o: Undefined symbol _rl_insert referenced from text segment
21+
myreadline.o: Undefined symbol _rl_bind_key referenced from text segment
22+
23+
I'm running on BSD/OS 2.0 with GCC 2.6.3 as the compiler. My configure line
24+
was
25+
26+
./configure --with-readline=/home/dolphin/skip/src/editline \
27+
--with-dl-dld=/home/dolphin/skip/src/dl-dld,/home/dolphin/skip/src/dld
28+
29+
For editline I tried several things before arriving at something that does
30+
work ... sort of. First I commented out the tab key binding in Python's
31+
Parser/myreadline.c then had to fiddle with editline.c to get tabs to
32+
insert. The diffs below seem to work, but have no notion of tab stops (I
33+
like 4-char tab stops).
34+
35+
I'd be grateful if anybody had a solution to the readline staircases or a
36+
better solution for making editline work.
37+
38+
*** editline.c~ Tue Nov 15 08:53:01 1994
39+
--- editline.c Sun Nov 19 09:15:16 1995
40+
***************
41+
*** 142,145 ****
42+
--- 142,148 ----
43+
TTYput('?');
44+
}
45+
+ else if (c == '\t') {
46+
+ TTYput('\t');
47+
+ }
48+
else if (ISCTL(c)) {
49+
TTYput('^');
50+
***************
51+
*** 1326,1329 ****
52+
--- 1329,1338 ----
53+
}
54+
55+
+ STATIC STATUS
56+
+ tab()
57+
+ {
58+
+ return insert_char('\t');
59+
+ }
60+
+
61+
STATIC KEYMAP Map[33] = {
62+
{ CTL('@'), ring_bell },
63+
***************
64+
*** 1335,1339 ****
65+
{ CTL('G'), ring_bell },
66+
{ CTL('H'), bk_del_char },
67+
! { CTL('I'), c_complete },
68+
{ CTL('J'), accept_line },
69+
{ CTL('K'), kill_line },
70+
--- 1344,1348 ----
71+
{ CTL('G'), ring_bell },
72+
{ CTL('H'), bk_del_char },
73+
! { CTL('I'), tab },
74+
{ CTL('J'), accept_line },
75+
{ CTL('K'), kill_line },
76+
--
77+
Skip Montanaro skip@automatrix.com (518)372-5583
78+
Musi-Cal: http://www.calendar.com/concerts/ or mailto:concerts@calendar.com
79+
Internet Conference Calendar: http://www.calendar.com/conferences/
80+
>>> ZLDF: http://www.netresponse.com/zldf <<<

0 commit comments

Comments
 (0)
0