home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Python20_source / Misc / editline-fix < prev    next >
Encoding:
Text File  |  2000-10-25  |  2.4 KB  |  81 lines

  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.   STATIC KEYMAP    Map[33] = {
  61.       {    CTL('@'),    ring_bell    },
  62. ***************
  63. *** 1335,1339 ****
  64.       {    CTL('G'),    ring_bell    },
  65.       {    CTL('H'),    bk_del_char    },
  66. !     {    CTL('I'),    c_complete    },
  67.       {    CTL('J'),    accept_line    },
  68.       {    CTL('K'),    kill_line    },
  69. --- 1344,1348 ----
  70.       {    CTL('G'),    ring_bell    },
  71.       {    CTL('H'),    bk_del_char    },
  72. !     {    CTL('I'),    tab        },
  73.       {    CTL('J'),    accept_line    },
  74.       {    CTL('K'),    kill_line    },
  75. -- 
  76. Skip Montanaro        skip@automatrix.com              (518)372-5583
  77. Musi-Cal: http://www.calendar.com/concerts/ or mailto:concerts@calendar.com
  78. Internet Conference Calendar: http://www.calendar.com/conferences/
  79.            >>> ZLDF: http://www.netresponse.com/zldf <<<
  80.