blob: 713b1a4e5112f605fef1f5c31ba687a7141286bd [file] [log] [blame]
Guido van Rossumdc082eb1996-09-12 17:29:33 +00001Subject: Problems trying to use readline or editline ...
2From: Skip Montanaro <skip@dolphin.automatrix.com>
3To: python-list@cwi.nl
4Date: 19 Nov 1995 14:19:56 GMT
5X-Newsgroups: comp.lang.python
6X-Organization: Automatrix, Inc.
7
8
9I'm having some trouble with either of the line editing libraries available
10to me. If I build Python with libreadline, I get "staircases" in my
11interpreter output:
12
13 >>> s = 1
14 >>> a = 3
15 >>> etc.
16
17So I figured I'd give Rich Salz's editline a try. It seems to be missing a
18couple 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
23I'm running on BSD/OS 2.0 with GCC 2.6.3 as the compiler. My configure line
24was
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
29For editline I tried several things before arriving at something that does
30work ... sort of. First I commented out the tab key binding in Python's
31Parser/myreadline.c then had to fiddle with editline.c to get tabs to
32insert. The diffs below seem to work, but have no notion of tab stops (I
33like 4-char tab stops).
34
35I'd be grateful if anybody had a solution to the readline staircases or a
36better 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--
77Skip Montanaro skip@automatrix.com (518)372-5583
78Musi-Cal: http://www.calendar.com/concerts/ or mailto:concerts@calendar.com
79Internet Conference Calendar: http://www.calendar.com/conferences/
80 >>> ZLDF: http://www.netresponse.com/zldf <<<