Fix an amazing number of typos & malformed sentences reported by Detlef
[python/dscho.git] / Misc / editline-fix
blob713b1a4e5112f605fef1f5c31ba687a7141286bd
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.
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:
13     >>> s = 1
14              >>> a = 3
15                       >>> etc.
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:
20     myreadline.o: Undefined symbol _rl_insert referenced from text segment
21     myreadline.o: Undefined symbol _rl_bind_key referenced from text segment
23 I'm running on BSD/OS 2.0 with GCC 2.6.3 as the compiler.  My configure line
24 was
26     ./configure --with-readline=/home/dolphin/skip/src/editline \
27         --with-dl-dld=/home/dolphin/skip/src/dl-dld,/home/dolphin/skip/src/dld
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).
35 I'd be grateful if anybody had a solution to the readline staircases or a
36 better solution for making editline work.
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 <<<