home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1133 < prev    next >
Internet Message Format  |  1990-12-28  |  35KB

  1. From: howard@hasse.ericsson.se (Howard Gayle)
  2. Newsgroups: alt.sources
  3. Subject: GNU Emacs 8-bit mods part 06 of 12
  4. Message-ID: <1990Apr5.133749.8930@ericsson.se>
  5. Date: 5 Apr 90 13:37:49 GMT
  6.  
  7. *** ../18.55/src/editfns.c    Fri Jul 21 20:21:32 1989
  8. --- src/editfns.c    Thu Apr  5 09:11:21 1990
  9. ***************
  10. *** 1,5 ****
  11.   /* Lisp functions pertaining to editing.
  12. !    Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
  13.   
  14.   This file is part of GNU Emacs.
  15.   
  16. --- 1,5 ----
  17.   /* Lisp functions pertaining to editing.
  18. !    Copyright (C) 1985, 1986, 1987, 1990 Free Software Foundation, Inc.
  19.   
  20.   This file is part of GNU Emacs.
  21.   
  22. ***************
  23. *** 19,28 ****
  24. --- 19,34 ----
  25.   and this notice must be preserved on all copies.  */
  26.   
  27.   
  28. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  29. +  *  See chartab.c for details. */
  30.   #include "config.h"
  31.   #include <pwd.h>
  32.   #include "lisp.h"
  33. + #include "chartab.h"
  34.   #include "buffer.h"
  35. + #include "sorttab.h"
  36.   #include "window.h"
  37.   
  38.   #define min(a, b) ((a) < (b) ? (a) : (b))
  39. ***************
  40. *** 375,385 ****
  41.        point>NumCharacters)
  42.   DEFPRED ("bolp", Fbolp, Sbolp,
  43.     "Return T if point is at the beginning of a line.",
  44. !      point<=FirstCharacter || CharAt(point-1)=='\n')
  45.   DEFPRED ("eolp", Feolp, Seolp,
  46.     "Return T if point is at the end of a line.\n\
  47.   `End of a line' includes point being at the end of the buffer.",
  48. !      point>NumCharacters || CharAt(point)=='\n')
  49.   
  50.   DEFUN ("char-after", Fchar_after, Schar_after, 1, 1, 0,
  51.     "One arg, POS, a number.  Return the character in the current buffer\n\
  52. --- 381,391 ----
  53.        point>NumCharacters)
  54.   DEFPRED ("bolp", Fbolp, Sbolp,
  55.     "Return T if point is at the beginning of a line.",
  56. !      point<=FirstCharacter || CharAt(point-1)==NEWLINE)
  57.   DEFPRED ("eolp", Feolp, Seolp,
  58.     "Return T if point is at the end of a line.\n\
  59.   `End of a line' includes point being at the end of the buffer.",
  60. !      point>NumCharacters || CharAt(point)==NEWLINE)
  61.   
  62.   DEFUN ("char-after", Fchar_after, Schar_after, 1, 1, 0,
  63.     "One arg, POS, a number.  Return the character in the current buffer\n\
  64. ***************
  65. *** 955,968 ****
  66.     (c1, c2)
  67.        register Lisp_Object c1, c2;
  68.   {
  69.     CHECK_NUMBER (c1, 0);
  70.     CHECK_NUMBER (c2, 1);
  71.   
  72. !   if (!NULL (bf_cur->case_fold_search)
  73. !       ? downcase_table[0xff & XFASTINT (c1)] == downcase_table[0xff & XFASTINT (c2)]
  74. !       : XINT (c1) == XINT (c2))
  75. !     return Qt;
  76. !   return Qnil;
  77.   }
  78.   
  79.   #ifndef MAINTAIN_ENVIRONMENT /* it is done in environ.c in that case */
  80. --- 961,976 ----
  81.     (c1, c2)
  82.        register Lisp_Object c1, c2;
  83.   {
  84. +   register char_t *tt; /* Equivalence class table. */
  85.     CHECK_NUMBER (c1, 0);
  86.     CHECK_NUMBER (c2, 1);
  87.   
  88. !   tt = current_equiv_class_table ();
  89. !   if (tt)
  90. !      return ((tt[0377 & XFASTINT (c1)] == tt[0377 & XFASTINT (c2)]) ? Qt
  91. !                                                                                      : Qnil);
  92. !   else
  93. !      return ((XINT (c1) == XINT (c2)) ? Qt : Qnil);
  94.   }
  95.   
  96.   #ifndef MAINTAIN_ENVIRONMENT /* it is done in environ.c in that case */
  97. *** ../18.55/src/emacs.c    Mon Mar 13 22:41:29 1989
  98. --- src/emacs.c    Thu Apr  5 09:11:33 1990
  99. ***************
  100. *** 1,5 ****
  101.   /* Fully extensible Emacs, running on Unix, intended for GNU.
  102. !    Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
  103.   
  104.   This file is part of GNU Emacs.
  105.   
  106. --- 1,5 ----
  107.   /* Fully extensible Emacs, running on Unix, intended for GNU.
  108. !    Copyright (C) 1985, 1986, 1987, 1990 Free Software Foundation, Inc.
  109.   
  110.   This file is part of GNU Emacs.
  111.   
  112. ***************
  113. *** 19,24 ****
  114. --- 19,28 ----
  115.   and this notice must be preserved on all copies.  */
  116.   
  117.   
  118. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  119. +  *  See chartab.c for details. */
  120.   #include <signal.h>
  121.   #include <errno.h>
  122.   
  123. ***************
  124. *** 329,334 ****
  125. --- 333,342 ----
  126.         init_obarray ();
  127.         init_eval_once ();
  128.         init_syntax_once ();    /* Create standard syntax table.  */
  129. +       init_case_table_once ();    /* Create standard case table.  */
  130. +       init_char_table_once ();    /* Create standard char tables.  */
  131. +       init_sort_table_once ();    /* Create standard sort tables.  */
  132. +       init_trans_table_once ();    /* Create standard trans tables.  */
  133.                 /* Must be done before init_buffer */
  134.         init_buffer_once ();    /* Create buffer table and some buffers */
  135.         init_minibuf_once ();    /* Create list of minibuffers */
  136. ***************
  137. *** 387,394 ****
  138. --- 395,404 ----
  139.         syms_of_buffer ();
  140.         syms_of_bytecode ();
  141.         syms_of_callint ();
  142. +       syms_of_case_table ();
  143.         syms_of_casefiddle ();
  144.         syms_of_callproc ();
  145. +       syms_of_char_table ();
  146.         syms_of_cmds ();
  147.   #ifndef NO_DIR_LIBRARY
  148.         syms_of_dired ();
  149. ***************
  150. *** 412,418 ****
  151. --- 422,430 ----
  152.         syms_of_process ();
  153.   #endif /* subprocesses */
  154.         syms_of_search ();
  155. +       syms_of_sort_table ();
  156.         syms_of_syntax ();
  157. +       syms_of_trans_table ();
  158.         syms_of_undo ();
  159.         syms_of_window ();
  160.         syms_of_xdisp ();
  161. *** ../18.55/src/fileio.c    Wed Jul  5 03:00:25 1989
  162. --- src/fileio.c    Thu Apr  5 09:11:54 1990
  163. ***************
  164. *** 1,5 ****
  165.   /* File IO for GNU Emacs.
  166. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  167.   
  168.   This file is part of GNU Emacs.
  169.   
  170. --- 1,5 ----
  171.   /* File IO for GNU Emacs.
  172. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  173.   
  174.   This file is part of GNU Emacs.
  175.   
  176. ***************
  177. *** 19,24 ****
  178. --- 19,28 ----
  179.   and this notice must be preserved on all copies.  */
  180.   
  181.   
  182. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  183. +  *  See chartab.c for details. */
  184.   #include <sys/types.h>
  185.   #include <sys/stat.h>
  186.   #include <pwd.h>
  187. ***************
  188. *** 42,47 ****
  189. --- 46,52 ----
  190.   #include "config.h"
  191.   #include "lisp.h"
  192.   #include "buffer.h"
  193. + #include "transtab.h"
  194.   #include "window.h"
  195.   
  196.   #ifdef VMS
  197. *** ../18.55/src/fns.c    Fri Apr  7 04:25:38 1989
  198. --- src/fns.c    Thu Apr  5 09:12:06 1990
  199. ***************
  200. *** 1,5 ****
  201.   /* Random utility Lisp functions.
  202. !    Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
  203.   
  204.   This file is part of GNU Emacs.
  205.   
  206. --- 1,5 ----
  207.   /* Random utility Lisp functions.
  208. !    Copyright (C) 1985, 1986, 1987, 1990 Free Software Foundation, Inc.
  209.   
  210.   This file is part of GNU Emacs.
  211.   
  212. ***************
  213. *** 19,24 ****
  214. --- 19,28 ----
  215.   and this notice must be preserved on all copies.  */
  216.   
  217.   
  218. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  219. +  *  See chartab.c for details. */
  220.   #include "config.h"
  221.   
  222.   #ifdef LOAD_AVE_TYPE
  223. ***************
  224. *** 61,71 ****
  225.   #undef NULL
  226.   #endif
  227.   #include "lisp.h"
  228. - #include "commands.h"
  229. - #ifdef lint
  230.   #include "buffer.h"
  231. ! #endif /* lint */
  232.   
  233.   Lisp_Object Qstring_lessp;
  234.   
  235. --- 65,73 ----
  236.   #undef NULL
  237.   #endif
  238.   #include "lisp.h"
  239.   #include "buffer.h"
  240. ! #include "commands.h"
  241. ! #include "transtab.h"
  242.   
  243.   Lisp_Object Qstring_lessp;
  244.   
  245. ***************
  246. *** 181,186 ****
  247. --- 183,189 ----
  248.       }
  249.     return i < XSTRING (s2)->size ? Qt : Qnil;
  250.   }
  251.   
  252.   static Lisp_Object concat ();
  253.   
  254. *** ../18.55/src/indent.c    Tue Aug 16 04:51:14 1988
  255. --- src/indent.c    Thu Apr  5 09:13:35 1990
  256. ***************
  257. *** 1,5 ****
  258.   /* Indentation functions.
  259. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  260.   
  261.   This file is part of GNU Emacs.
  262.   
  263. --- 1,5 ----
  264.   /* Indentation functions.
  265. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  266.   
  267.   This file is part of GNU Emacs.
  268.   
  269. ***************
  270. *** 19,34 ****
  271.   and this notice must be preserved on all copies.  */
  272.   
  273.   
  274.   #include "config.h"
  275.   #include "lisp.h"
  276.   #include "buffer.h"
  277.   #include "indent.h"
  278.   #include "window.h"
  279.   #include "termchar.h"
  280.   #include "termopts.h"
  281.   
  282. - #define CR '\015'
  283.   /* Indentation can insert tabs if this is non-zero;
  284.      otherwise always uses spaces */
  285.   int indent_tabs_mode;
  286. --- 19,37 ----
  287.   and this notice must be preserved on all copies.  */
  288.   
  289.   
  290. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  291. +  *  See chartab.c for details. */
  292.   #include "config.h"
  293.   #include "lisp.h"
  294.   #include "buffer.h"
  295. + #include "chartab.h"
  296.   #include "indent.h"
  297.   #include "window.h"
  298.   #include "termchar.h"
  299.   #include "termopts.h"
  300.   
  301.   /* Indentation can insert tabs if this is non-zero;
  302.      otherwise always uses spaces */
  303.   int indent_tabs_mode;
  304. ***************
  305. *** 52,61 ****
  306.     "Return the horizontal position of point.  Beginning of line is column 0.\n\
  307.   This is calculated by adding together the widths of all the displayed\n\
  308.   representations of the character between the start of the previous line\n\
  309. ! and point.  (eg control characters will have a width of 2 or 4, tabs\n\
  310. ! will have a variable width)\n\
  311. ! Ignores finite width of screen, which means that this function may return\n\
  312. ! values greater than (screen-width).\n\
  313.   Whether the line is visible (if `selective-display' is t) has no effect.",
  314.     Lisp_Int, XSETINT, current_column ())
  315.   
  316. --- 55,62 ----
  317.     "Return the horizontal position of point.  Beginning of line is column 0.\n\
  318.   This is calculated by adding together the widths of all the displayed\n\
  319.   representations of the character between the start of the previous line\n\
  320. ! and point.  Ignores finite width of screen, which means that\n\
  321. ! this function may return values greater than (screen-width).\n\
  322.   Whether the line is visible (if `selective-display' is t) has no effect.",
  323.     Lisp_Int, XSETINT, current_column ())
  324.   
  325. ***************
  326. *** 63,73 ****
  327.   current_column ()
  328.   {
  329.     register int col;
  330. !   register unsigned char *ptr, *stop, c;
  331.     register int tab_seen;
  332.     register int post_tab;
  333.     register int tab_width = XINT (bf_cur->tab_width);
  334. !   int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  335.   
  336.     if (point == last_known_column_point
  337.         && bf_modified == last_known_column_modified)
  338. --- 64,75 ----
  339.   current_column ()
  340.   {
  341.     register int col;
  342. !   register unsigned char *ptr, *stop;
  343. !   register char_t c;
  344.     register int tab_seen;
  345.     register int post_tab;
  346.     register int tab_width = XINT (bf_cur->tab_width);
  347. !   register struct Lisp_Chartab *cp;
  348.   
  349.     if (point == last_known_column_point
  350.         && bf_modified == last_known_column_modified)
  351. ***************
  352. *** 78,83 ****
  353. --- 80,86 ----
  354.     if (tab_width <= 0 || tab_width > 20) tab_width = 8;
  355.   
  356.     col = 0, tab_seen = 0, post_tab = 0;
  357. +   cp = SELECTED_CHAR_TABLE;
  358.   
  359.     while (1)
  360.       {
  361. ***************
  362. *** 91,105 ****
  363.       }
  364.   
  365.         c = *--ptr;
  366. !       if (c >= 040 && c < 0177)
  367. !     {
  368. !       col++;
  369. !     }
  370. !       else if (c == '\n')
  371.       break;
  372. !       else if (c == '\r' && EQ (bf_cur->selective_display, Qt))
  373.       break;
  374. !       else if (c == '\t')
  375.       {
  376.         if (tab_seen)
  377.           col = ((col + tab_width) / tab_width) * tab_width;
  378. --- 94,104 ----
  379.       }
  380.   
  381.         c = *--ptr;
  382. !       if (c == NEWLINE)
  383.       break;
  384. !       else if (c == cp->ct_invisc && EQ (bf_cur->selective_display, Qt))
  385.       break;
  386. !       else if (c == HTAB)
  387.       {
  388.         if (tab_seen)
  389.           col = ((col + tab_width) / tab_width) * tab_width;
  390. ***************
  391. *** 109,115 ****
  392.         tab_seen = 1;
  393.       }
  394.         else
  395. !     col += (ctl_arrow && c < 0200) ? 2 : 4;
  396.       }
  397.   
  398.     if (tab_seen)
  399. --- 108,114 ----
  400.         tab_seen = 1;
  401.       }
  402.         else
  403. !     col += ROPE_LEN (c, cp);
  404.       }
  405.   
  406.     if (tab_seen)
  407. ***************
  408. *** 200,206 ****
  409.        register int pos;
  410.   {
  411.     register int col = 0;
  412. !   register int c;
  413.     register int end = NumCharacters + 1;
  414.     register int tab_width = XINT (bf_cur->tab_width);
  415.   
  416. --- 199,205 ----
  417.        register int pos;
  418.   {
  419.     register int col = 0;
  420. !   register char_t c;
  421.     register int end = NumCharacters + 1;
  422.     register int tab_width = XINT (bf_cur->tab_width);
  423.   
  424. ***************
  425. *** 208,215 ****
  426.   
  427.     while (pos < end &&
  428.        (c = CharAt (pos),
  429. !       c == '\t' ? (col += tab_width - col % tab_width)
  430. !         : (c == ' ' ? ++col : 0)))
  431.       pos++;
  432.   
  433.     return col;
  434. --- 207,214 ----
  435.   
  436.     while (pos < end &&
  437.        (c = CharAt (pos),
  438. !       c == HTAB ? (col += tab_width - col % tab_width)
  439. !         : (c == SPACE ? ++col : 0)))
  440.       pos++;
  441.   
  442.     return col;
  443. ***************
  444. *** 219,228 ****
  445.     "Move point to column COLUMN in the current line.\n\
  446.   COLUMN is calculated by adding together the widths of all the displayed\n\
  447.   representations of the character between the start of the previous line\n\
  448. ! and point.  (eg control characters will have a width of 2 or 4, tabs\n\
  449. ! will have a variable width)\n\
  450. ! Ignores finite width of screen, which means that this function may be\n\
  451. ! passed values greater than (screen-width)")
  452.     (column)
  453.        Lisp_Object column;
  454.   {
  455. --- 218,225 ----
  456.     "Move point to column COLUMN in the current line.\n\
  457.   COLUMN is calculated by adding together the widths of all the displayed\n\
  458.   representations of the character between the start of the previous line\n\
  459. ! and point.  Ignores finite width of screen, which means that\n\
  460. ! this function may be passed values greater than (screen-width)")
  461.     (column)
  462.        Lisp_Object column;
  463.   {
  464. ***************
  465. *** 231,237 ****
  466.     register int goal;
  467.     register int end = NumCharacters;
  468.     register int tab_width = XINT (bf_cur->tab_width);
  469. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  470.   
  471.     Lisp_Object val;
  472.   
  473. --- 228,234 ----
  474.     register int goal;
  475.     register int end = NumCharacters;
  476.     register int tab_width = XINT (bf_cur->tab_width);
  477. !   register struct Lisp_Chartab *cp = SELECTED_CHAR_TABLE;
  478.   
  479.     Lisp_Object val;
  480.   
  481. ***************
  482. *** 247,267 ****
  483.     while (col < goal && pos <= end)
  484.       {
  485.         int c = CharAt (pos);
  486. !       if (c == '\n')
  487.       break;
  488. !       if (c == '\r' && EQ (bf_cur->selective_display, Qt))
  489.       break;
  490.         pos++;
  491. !       col++;
  492. !       if (c == '\t')
  493.       {
  494. !       col += tab_width - 1;
  495.         col = col / tab_width * tab_width;
  496.       }
  497. !       else if (ctl_arrow && (c < 040 || c == 0177))
  498. !         col++;
  499. !       else if (c < 040 || c >= 0177)
  500. !         col += 3;
  501.       }
  502.   
  503.     SetPoint (pos);
  504. --- 244,261 ----
  505.     while (col < goal && pos <= end)
  506.       {
  507.         int c = CharAt (pos);
  508. !       if (c == NEWLINE)
  509.       break;
  510. !       if (c == cp->ct_invisc && EQ (bf_cur->selective_display, Qt))
  511.       break;
  512.         pos++;
  513. !       if (c == HTAB)
  514.       {
  515. !       col += tab_width;
  516.         col = col / tab_width * tab_width;
  517.       }
  518. !       else
  519. !     col += ROPE_LEN (c, cp);
  520.       }
  521.   
  522.     SetPoint (pos);
  523. ***************
  524. *** 304,312 ****
  525.       int cpos = fromhpos + (fromvpos << SHORTBITS);
  526.     register int target = tohpos + (tovpos << SHORTBITS);
  527.     register int pos;
  528. !   register int c;
  529.     register int tab_width = XFASTINT (bf_cur->tab_width);
  530. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  531.     int selective
  532.       = XTYPE (bf_cur->selective_display) == Lisp_Int
  533.         ? XINT (bf_cur->selective_display)
  534. --- 298,306 ----
  535.       int cpos = fromhpos + (fromvpos << SHORTBITS);
  536.     register int target = tohpos + (tovpos << SHORTBITS);
  537.     register int pos;
  538. !   register char_t c;
  539.     register int tab_width = XFASTINT (bf_cur->tab_width);
  540. !   register struct Lisp_Chartab *cp = SELECTED_CHAR_TABLE;
  541.     int selective
  542.       = XTYPE (bf_cur->selective_display) == Lisp_Int
  543.         ? XINT (bf_cur->selective_display)
  544. ***************
  545. *** 318,326 ****
  546.       {
  547.         prevpos = cpos;
  548.         c = CharAt (pos);
  549. !       if (c >= 040 && c < 0177)
  550. !     cpos++;
  551. !       else if (c == '\t')
  552.       {
  553.         cpos += tab_width
  554.           - HPOS (cpos + tab_offset + hscroll - (hscroll > 0)
  555. --- 312,318 ----
  556.       {
  557.         prevpos = cpos;
  558.         c = CharAt (pos);
  559. !       if (c == HTAB)
  560.       {
  561.         cpos += tab_width
  562.           - HPOS (cpos + tab_offset + hscroll - (hscroll > 0)
  563. ***************
  564. *** 330,336 ****
  565.               + tab_width)
  566.             % tab_width;
  567.       }
  568. !       else if (c == '\n')
  569.       {
  570.         if (selective > 0 && position_indentation (pos + 1) >= selective)
  571.           {
  572. --- 322,328 ----
  573.               + tab_width)
  574.             % tab_width;
  575.       }
  576. !       else if (c == NEWLINE)
  577.       {
  578.         if (selective > 0 && position_indentation (pos + 1) >= selective)
  579.           {
  580. ***************
  581. *** 337,353 ****
  582.             /* Skip any number of invisible lines all at once */
  583.             do
  584.           {
  585. !           while (++pos < to && CharAt(pos) != '\n');
  586.           }
  587.             while (selective > 0 && position_indentation (pos + 1) >= selective);
  588.             pos--;
  589. !           /* Allow for the " ..." that is displayed for them. */
  590. !           if (!NULL (bf_cur->selective_display_ellipses))
  591. !         {
  592. !           cpos += 4;
  593. !           if (HPOS (cpos) >= width)
  594. !             cpos -= HPOS (cpos) - width;
  595. !         }
  596.           }
  597.         else
  598.           cpos += (1 << SHORTBITS) - HPOS (cpos);
  599. --- 329,341 ----
  600.             /* Skip any number of invisible lines all at once */
  601.             do
  602.           {
  603. !           while (++pos < to && CharAt(pos) != NEWLINE);
  604.           }
  605.             while (selective > 0 && position_indentation (pos + 1) >= selective);
  606.             pos--;
  607. !           cpos += cp->ct_invisr.r_len;
  608. !           if (HPOS (cpos) >= width)
  609. !         cpos -= HPOS (cpos) - width;
  610.           }
  611.         else
  612.           cpos += (1 << SHORTBITS) - HPOS (cpos);
  613. ***************
  614. *** 355,381 ****
  615.         if (hscroll > 0) cpos++; /* Count the ! on column 0 */
  616.         tab_offset = 0;
  617.       }
  618. !       else if (c == CR && selective < 0)
  619.       {
  620.         /* In selective display mode,
  621.            everything from a ^M to the end of the line is invisible */
  622. !       while (pos < to && CharAt(pos) != '\n') pos++;
  623.         pos--;
  624. !       /* Allow for the " ..." that is displayed for them. */
  625. !       if (!NULL (bf_cur->selective_display_ellipses))
  626. !         {
  627. !           cpos += 4;
  628. !           if (HPOS (cpos) >= width)
  629. !         cpos -= HPOS (cpos) - width;
  630. !         }
  631.       }
  632.         else
  633. !     cpos += (ctl_arrow && c < 0200) ? 2 : 4;
  634.   
  635.         if (HPOS (cpos) >= width
  636.         && (HPOS (cpos) > width
  637.             || (pos < NumCharacters
  638. !           && CharAt (pos + 1) != '\n')))
  639.       {
  640.         if (cpos >= target)
  641.           break;
  642. --- 343,365 ----
  643.         if (hscroll > 0) cpos++; /* Count the ! on column 0 */
  644.         tab_offset = 0;
  645.       }
  646. !       else if (c == cp->ct_invisc && selective < 0)
  647.       {
  648.         /* In selective display mode,
  649.            everything from a ^M to the end of the line is invisible */
  650. !       while (pos < to && CharAt(pos) != NEWLINE) pos++;
  651.         pos--;
  652. !       cpos += cp->ct_invisr.r_len;
  653. !       if (HPOS (cpos) >= width)
  654. !         cpos -= HPOS (cpos) - width;
  655.       }
  656.         else
  657. !     cpos += ROPE_LEN (c, cp);
  658.   
  659.         if (HPOS (cpos) >= width
  660.         && (HPOS (cpos) > width
  661.             || (pos < NumCharacters
  662. !           && CharAt (pos + 1) != NEWLINE)))
  663.       {
  664.         if (cpos >= target)
  665.           break;
  666. ***************
  667. *** 384,390 ****
  668.             && width + 1 < screen_width)
  669.             || !NULL (bf_cur->truncate_lines))
  670.           {
  671. !           while (pos < to && CharAt(pos) != '\n') pos++;
  672.             pos--;
  673.           }
  674.         else
  675. --- 368,374 ----
  676.             && width + 1 < screen_width)
  677.             || !NULL (bf_cur->truncate_lines))
  678.           {
  679. !           while (pos < to && CharAt(pos) != NEWLINE) pos++;
  680.             pos--;
  681.           }
  682.         else
  683. ***************
  684. *** 405,411 ****
  685.     val_compute_motion.contin
  686.       = pos != from
  687.         && (val_compute_motion.vpos != VPOS (prevpos))
  688. !       && c != '\n';
  689.   
  690.     return &val_compute_motion;
  691.   }
  692. --- 389,395 ----
  693.     val_compute_motion.contin
  694.       = pos != from
  695.         && (val_compute_motion.vpos != VPOS (prevpos))
  696. !       && c != NEWLINE;
  697.   
  698.     return &val_compute_motion;
  699.   }
  700. ***************
  701. *** 420,426 ****
  702.     int opoint = point;
  703.     int col;
  704.   
  705. !   if (pos == FirstCharacter || CharAt (pos - 1) == '\n')
  706.       return 0;
  707.     SetPoint (pos);
  708.     col = current_column ();
  709. --- 404,410 ----
  710.     int opoint = point;
  711.     int col;
  712.   
  713. !   if (pos == FirstCharacter || CharAt (pos - 1) == NEWLINE)
  714.       return 0;
  715.     SetPoint (pos);
  716.     col = current_column ();
  717. ***************
  718. *** 457,463 ****
  719.       {
  720.         /* Moving downward is simple, but must calculate from beg of line 
  721.        to determine hpos of starting point */
  722. !       if (from > FirstCharacter && CharAt (from - 1) != '\n')
  723.       {
  724.         prevline = find_next_newline (from, -1);
  725.         while (selective > 0
  726. --- 441,447 ----
  727.       {
  728.         /* Moving downward is simple, but must calculate from beg of line 
  729.        to determine hpos of starting point */
  730. !       if (from > FirstCharacter && CharAt (from - 1) != NEWLINE)
  731.       {
  732.         prevline = find_next_newline (from, -1);
  733.         while (selective > 0
  734. *** ../18.55/src/keyboard.c    Thu Jul 20 07:32:59 1989
  735. --- src/keyboard.c    Thu Apr  5 09:12:26 1990
  736. ***************
  737. *** 1,5 ****
  738.   /* Keyboard input; editor command loop.
  739. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  740.   
  741.   This file is part of GNU Emacs.
  742.   
  743. --- 1,5 ----
  744.   /* Keyboard input; editor command loop.
  745. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  746.   
  747.   This file is part of GNU Emacs.
  748.   
  749. ***************
  750. *** 18,23 ****
  751. --- 18,27 ----
  752.   file named COPYING.  Among other things, the copyright notice
  753.   and this notice must be preserved on all copies.  */
  754.   
  755. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  756. +  *  See chartab.c for details. */
  757.   /*** For version 19, can simplify this by making interrupt_input 1 on VMS.  */
  758.   
  759.   /* Allow config.h to undefine symbols found here.  */
  760. ***************
  761. *** 32,39 ****
  762. --- 36,46 ----
  763.   #include "lisp.h"
  764.   #include "macros.h"
  765.   #include "window.h"
  766. + #include "casetab.h"
  767. + #include "chartab.h"
  768.   #include "commands.h"
  769.   #include "buffer.h"
  770. + #include "transtab.h"
  771.   #include <setjmp.h>
  772.   #include <errno.h>
  773.   
  774. ***************
  775. *** 591,599 ****
  776.           {
  777.             if (EQ (cmd, Qforward_char) && point <= NumCharacters)
  778.           {
  779.             lose = CharAt (point);
  780.             SetPoint (point + 1);
  781. !           if (lose >= ' ' && lose < 0177
  782.                 && (XFASTINT (XWINDOW (selected_window)->last_modified)
  783.                 >= bf_modified)
  784.                 && (XFASTINT (XWINDOW (selected_window)->last_point)
  785. --- 598,608 ----
  786.           {
  787.             if (EQ (cmd, Qforward_char) && point <= NumCharacters)
  788.           {
  789. +                   register struct Lisp_Chartab *cp = SELECTED_CHAR_TABLE;
  790.             lose = CharAt (point);
  791.             SetPoint (point + 1);
  792. !           if (1 == ROPE_LEN (lose, cp)
  793.                 && (XFASTINT (XWINDOW (selected_window)->last_modified)
  794.                 >= bf_modified)
  795.                 && (XFASTINT (XWINDOW (selected_window)->last_point)
  796. ***************
  797. *** 607,615 ****
  798.           }
  799.             else if (EQ (cmd, Qbackward_char) && point > FirstCharacter)
  800.           {
  801.             SetPoint (point - 1);
  802.             lose = CharAt (point);
  803. !           if (lose >= ' ' && lose < 0177
  804.                 && (XFASTINT (XWINDOW (selected_window)->last_modified)
  805.                 >= bf_modified)
  806.                 && (XFASTINT (XWINDOW (selected_window)->last_point)
  807. --- 616,626 ----
  808.           }
  809.             else if (EQ (cmd, Qbackward_char) && point > FirstCharacter)
  810.           {
  811. +                   register struct Lisp_Chartab *cp = SELECTED_CHAR_TABLE;
  812.             SetPoint (point - 1);
  813.             lose = CharAt (point);
  814. !           if (1 == ROPE_LEN (lose, cp)
  815.                 && (XFASTINT (XWINDOW (selected_window)->last_modified)
  816.                 >= bf_modified)
  817.                 && (XFASTINT (XWINDOW (selected_window)->last_point)
  818. ***************
  819. *** 647,658 ****
  820.                 lose = 1;
  821.                 nonundocount = 0;
  822.               }
  823. !           if (!lose
  824. !               && (point == NumCharacters + 1 || CharAt (point) == '\n')
  825. !               && last_command_char >= ' '
  826. !               && last_command_char < 0177)
  827. !             no_redisplay
  828. !               = direct_output_for_insert (last_command_char);
  829.             goto directly_done;
  830.           }
  831.           }
  832. --- 658,674 ----
  833.                 lose = 1;
  834.                 nonundocount = 0;
  835.               }
  836. !           if (!lose &&
  837. !               (point == NumCharacters + 1
  838. !               || CharAt (point) == NEWLINE))
  839. !             {
  840. !               register rope_t *rp =
  841. !                   &SELECTED_CHAR_TABLE->ct_dispr[last_command_char];
  842. !               if (1 == rp->r_len)
  843. !                 no_redisplay =
  844. !               direct_output_for_insert (rp->r_glyfs[0]);
  845. !             }
  846.             goto directly_done;
  847.           }
  848.           }
  849. *** ../18.55/src/lisp.h    Wed Mar 30 08:42:49 1988
  850. --- src/lisp.h    Thu Apr  5 09:13:49 1990
  851. ***************
  852. *** 1,5 ****
  853.   /* Fundamental definitions for GNU Emacs Lisp interpreter.
  854. !    Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc.
  855.   
  856.   This file is part of GNU Emacs.
  857.   
  858. --- 1,5 ----
  859.   /* Fundamental definitions for GNU Emacs Lisp interpreter.
  860. !    Copyright (C) 1985, 1986, 1987, 1990 Free Software Foundation, Inc.
  861.   
  862.   This file is part of GNU Emacs.
  863.   
  864. ***************
  865. *** 19,24 ****
  866. --- 19,28 ----
  867.   and this notice must be preserved on all copies.  */
  868.   
  869.   
  870. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  871. +  *  See chartab.c for details. */
  872.   /* Define the fundamental Lisp data structures */
  873.   
  874.   /* This is the set of Lisp data types */
  875. ***************
  876. *** 45,61 ****
  877.       /* Cons.  object.v.cons points to a struct Lisp_Cons. */
  878.       Lisp_Cons,
  879.   
  880. !     /* >>> No longer used */
  881. !     Lisp_Object_Unused_1,
  882. ! #if 0
  883. !     was...
  884. !     /* Treated like vector in GC, except do not set its mark bit.
  885. !        Used for internal data blocks that will be explicitly freed
  886. !        but which, while active, are reached by GC mark exactly once
  887. !        and should be marked through like a vector.  */
  888. !     Lisp_Temp_Vector,
  889. ! #endif 0
  890.       /* Editor buffer.  obj.v.buffer points to a struct buffer.
  891.          No buffer is ever truly freed; they can be "killed", but this
  892.          just marks them as dead. */
  893. --- 49,57 ----
  894.       /* Cons.  object.v.cons points to a struct Lisp_Cons. */
  895.       Lisp_Cons,
  896.   
  897. !     /* A character table. */
  898. !     Lisp_Chartab,
  899. !     
  900.       /* Editor buffer.  obj.v.buffer points to a struct buffer.
  901.          No buffer is ever truly freed; they can be "killed", but this
  902.          just marks them as dead. */
  903. ***************
  904. *** 151,157 ****
  905.       Lisp_Window,
  906.   
  907.       /* Used by save,set,restore-window-configuration */
  908. !     Lisp_Window_Configuration
  909.     };
  910.   
  911.   #ifndef NO_UNION_TYPE
  912. --- 147,162 ----
  913.       Lisp_Window,
  914.   
  915.       /* Used by save,set,restore-window-configuration */
  916. !     Lisp_Window_Configuration,
  917. !     /* A case table. */
  918. !     Lisp_Casetab,
  919. !     /* A sort table. */
  920. !     Lisp_Sorttab,
  921. !     /* A trans table. */
  922. !     Lisp_Transtab
  923.     };
  924.   
  925.   #ifndef NO_UNION_TYPE
  926. ***************
  927. *** 396,401 ****
  928. --- 401,411 ----
  929.   #define XINTPTR(a) ((int *) XPNTR(a))
  930.   #define XWINDOW(a) ((struct window *) XPNTR(a))
  931.   #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
  932. + #define XCASETAB(a) ((struct Lisp_Casetab *) XPNTR(a))
  933. + #define XCHARTAB(a) ((struct Lisp_Chartab *) XPNTR(a))
  934. + #define XETCTAB(a) ((struct Lisp_Etctab *) XPNTR(a))
  935. + #define XSORTTAB(a) ((struct Lisp_Sorttab *) XPNTR(a))
  936. + #define XTRANSTAB(a) ((struct Lisp_Transtab *) XPNTR(a))
  937.   
  938.   #define XSETCONS(a, b) XSETPNTR(a, (int) (b))
  939.   #define XSETBUFFER(a, b) XSETPNTR(a, (int) (b))
  940. ***************
  941. *** 409,414 ****
  942. --- 419,425 ----
  943.   #define XSETINTPTR(a, b) XSETPNTR(a, (int) (b))
  944.   #define XSETWINDOW(a, b) XSETPNTR(a, (int) (b))
  945.   #define XSETPROCESS(a, b) XSETPNTR(a, (int) (b))
  946. + #define XSETCHARTAB(a, b) XSETPNTR(a, (int) (b))
  947.   
  948.   /* In a cons, the markbit of the car is the gc mark bit */
  949.   
  950. ***************
  951. *** 472,477 ****
  952. --- 483,581 ----
  953.       int modified;
  954.     };
  955.   
  956. + /* Characters, glyfs, ropes, case, character, sort and translate tables. */
  957. + struct Lisp_Etctab /* Header for garbage-collecting various tables. */
  958. +   {
  959. +   int                      etc_ser;  /* Mark and serial number. */
  960. +   struct Lisp_Etctab *etc_next; /* Thread. */
  961. +   };
  962. + /* For our purposes here, every character
  963. + is assigned to one of three mutually exclusive classes:
  964. +    1) caseless,
  965. +    2) lower case, or
  966. +    3) upper case.
  967. + This is represented by the following type: */
  968. + typedef enum {nocase_e, lowercase_e, uppercase_e} case_t;
  969. + /* A case table gives case information about the characters in
  970. + a character set. */
  971. + struct Lisp_Casetab
  972. +   {
  973. +     int                     cas_mark;      /* Mark bit & serial number. */
  974. +     struct Lisp_Casetab *cas_next;      /* Link for garbage collection. */
  975. +     case_t                   cas_case[256]; /* The data. */
  976. +   };
  977. + /* A character, declared with the following typedef, is a member
  978. + of some character set associated with the current buffer. */
  979. + typedef unsigned char char_t;
  980. + /* A char_t is displayed on a given terminal by means of a
  981. + sequence of one or more glyfs.  A glyf is something that takes
  982. + up exactly one display position on the screen: */
  983. + typedef short unsigned glyf_t;
  984. + /* Sequences of glyfs are known as ropes, just as sequences of
  985. + characters are known as strings.  A rope has a length and an
  986. + array of glyfs: */
  987. + #define MAXROPE 5 /* Max glyfs in a rope. */
  988. + typedef struct
  989. +    {
  990. +    short unsigned r_len;            /* Number of glyfs in rope. */
  991. +    glyf_t         r_glyfs[MAXROPE]; /* The glyfs. */
  992. +    } rope_t;
  993. + /* A character table: */
  994. + struct Lisp_Chartab
  995. +    {
  996. +    struct Lisp_Etctab ct_etc;
  997. +    glyf_t             ct_frameg;     /* Window frame mark, default |. */
  998. +    glyf_t             ct_truncg;     /* Truncation mark, default $. */
  999. +    glyf_t             ct_wrapg;      /* Wrap-around mark, default \. */
  1000. +    char_t             ct_invisc;     /* Selective display character. */
  1001. +    rope_t             ct_invisr;     /* Selective display rope. */
  1002. +    rope_t                ct_dispr[256]; /* Display ropes for each character. */
  1003. +    };
  1004. + /* A trans[late] table maps each character in a character set
  1005. + into another, possibly different character, such as its
  1006. + lower-case equivalent: */
  1007. + struct Lisp_Transtab
  1008. +   {
  1009. +     int                       trt_mark;    /* Mark bit & serial number. */
  1010. +     struct Lisp_Transtab *trt_next;    /* Link for garbage collection. */
  1011. +     char_t                    trt_to[256]; /* The table. */
  1012. +   };
  1013. + /* Sort tables are used for searching and sorting.  A sort
  1014. + table is two consecutive vectors of 256 bytes each (total 512
  1015. + bytes).  Each vector is indexed by character.  The first vector
  1016. + maps characters into equivalence class numbers.  These are
  1017. + ordered for sorting.  The second vector gives the next
  1018. + character in the equivalence class, in a circular,
  1019. + singly-linked list.  For example, consider the ISO 8859/1
  1020. + character set, and suppose we want n and n-with-tilde to be in
  1021. + the same equivalence class.  Let s[] be the sort table.  We need:
  1022. +    s['n'] == s['n-with-tilde']
  1023. + and
  1024. +    s['n'               + 256] == 'n-with-tilde'
  1025. +    s['n-with-tilde' + 256] == 'n' */
  1026. + typedef struct
  1027. +   {
  1028. +     char_t ec_lo;
  1029. +     char_t ec_hi;
  1030. +   } ec_dope_t;
  1031. + struct Lisp_Sorttab
  1032. +   {
  1033. +     struct Lisp_Etctab srt_etc;
  1034. +     char_t                srt_ec [256]; /* Equivalence class of each char. */
  1035. +     ec_dope_t          srt_dope[256]; /* Next char in equivalence class. */
  1036. +     char_t                srt_chars[256];
  1037. +   };
  1038.   /* Data type checking */
  1039.   
  1040.   #define NULL(x)  (XFASTINT (x) == XFASTINT (Qnil))
  1041. ***************
  1042. *** 662,692 ****
  1043.   
  1044.   #define QUITP (!NULL (Vquit_flag) && NULL (Vinhibit_quit))
  1045.   
  1046. - /* 1 if CH is upper case.  */
  1047. - #define UPPERCASEP(CH) (downcase_table[CH] != (CH))
  1048. - /* 1 if CH is lower case.  */
  1049. - #define LOWERCASEP(CH)   \
  1050. -  (downcase_table[CH] == (CH) && downcase_table[0400 + (CH)] != (CH))
  1051. - /* 1 if CH is neither upper nor lower case.  */
  1052. - #define NOCASEP(CH) (downcase_table[0400 + (CH)] == (CH))
  1053. - /* Upcase a character, or make no change if that cannot be done.  */
  1054. - #define UPCASE(CH) (downcase_table[CH] == (CH) ? UPCASE1 (CH) : (CH))
  1055. - /* Upcase a character known to be not upper case.  */
  1056. - #define UPCASE1(CH) downcase_table[0400 + (CH)]
  1057. - /* Downcase a character, or make no change if that cannot be done. */
  1058. - #define DOWNCASE(CH) downcase_table[CH]
  1059.   /* number of bytes of structure consed since last GC */
  1060.   
  1061.   extern int consing_since_gc;
  1062. --- 766,771 ----
  1063. ***************
  1064. *** 890,896 ****
  1065.   extern Lisp_Object Vfundamental_mode_abbrev_table;
  1066.   
  1067.   /* defined in search.c */
  1068. - extern unsigned char downcase_table[];
  1069.   extern Lisp_Object Fstring_match ();
  1070.   extern Lisp_Object Fscan_buffer ();
  1071.   
  1072. --- 969,974 ----
  1073. *** ../18.55/src/minibuf.c    Sat Apr  1 01:50:26 1989
  1074. --- src/minibuf.c    Thu Apr  5 09:14:01 1990
  1075. ***************
  1076. *** 1,5 ****
  1077.   /* Minibuffer input and completion.
  1078. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  1079.   
  1080.   This file is part of GNU Emacs.
  1081.   
  1082. --- 1,5 ----
  1083.   /* Minibuffer input and completion.
  1084. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  1085.   
  1086.   This file is part of GNU Emacs.
  1087.   
  1088. ***************
  1089. *** 19,28 ****
  1090. --- 19,33 ----
  1091.   and this notice must be preserved on all copies.  */
  1092.   
  1093.   
  1094. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  1095. +  *  See chartab.c for details. */
  1096.   #include "config.h"
  1097.   #include "lisp.h"
  1098.   #include "commands.h"
  1099.   #include "buffer.h"
  1100. + #include "transtab.h"
  1101.   #include "window.h"
  1102.   #include "syntax.h"
  1103.   #include "dispextern.h"
  1104. ***************
  1105. *** 491,497 ****
  1106.   
  1107.     if (completion_ignore_case)
  1108.       {
  1109. !       while (l && downcase_table[*s1++] == downcase_table[*s2++])
  1110.       l--;
  1111.       }
  1112.     else
  1113. --- 496,502 ----
  1114.   
  1115.     if (completion_ignore_case)
  1116.       {
  1117. !       while (l && DOWNCASE (*s1++) == DOWNCASE (*s2++))
  1118.       l--;
  1119.       }
  1120.     else
  1121. *** ../18.55/src/process.c    Mon Aug  7 00:01:31 1989
  1122. --- src/process.c    Thu Apr  5 09:12:42 1990
  1123. ***************
  1124. *** 1,5 ****
  1125.   /* Asynchronous subprocess control for GNU Emacs.
  1126. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  1127.   
  1128.   This file is part of GNU Emacs.
  1129.   
  1130. --- 1,5 ----
  1131.   /* Asynchronous subprocess control for GNU Emacs.
  1132. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  1133.   
  1134.   This file is part of GNU Emacs.
  1135.   
  1136. ***************
  1137. *** 19,24 ****
  1138. --- 19,28 ----
  1139.   and this notice must be preserved on all copies.  */
  1140.   
  1141.   
  1142. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  1143. +  *  See chartab.c for details. */
  1144.   #include <signal.h>
  1145.   
  1146.   #include "config.h"
  1147. ***************
  1148. *** 89,94 ****
  1149. --- 93,99 ----
  1150.   #include "process.h"
  1151.   #include "termhooks.h"
  1152.   #include "termopts.h"
  1153. + #include "transtab.h"
  1154.   #include "commands.h"
  1155.   
  1156.   /* a process object is a network connection when its childp field is neither
  1157. *** ../18.55/src/print.c    Thu Jul 28 17:12:41 1988
  1158. --- src/print.c    Thu Apr  5 09:14:12 1990
  1159. ***************
  1160. *** 1,5 ****
  1161.   /* Lisp object printing and output streams.
  1162. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  1163.   
  1164.   This file is part of GNU Emacs.
  1165.   
  1166. --- 1,5 ----
  1167.   /* Lisp object printing and output streams.
  1168. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  1169.   
  1170.   This file is part of GNU Emacs.
  1171.   
  1172. ***************
  1173. *** 19,24 ****
  1174. --- 19,28 ----
  1175.   and this notice must be preserved on all copies.  */
  1176.   
  1177.   
  1178. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  1179. +  *  See chartab.c for details. */
  1180.   #include "config.h"
  1181.   #include <stdio.h>
  1182.   #undef NULL
  1183. ***************
  1184. *** 641,646 ****
  1185. --- 645,671 ----
  1186.         strout (" in ", -1, printcharfun);
  1187.         strout (XSTRING (XMARKER (obj)->buffer->name)->data, -1, printcharfun);
  1188.       }
  1189. +       PRINTCHAR ('>');
  1190. +       break;
  1191. +     case Lisp_Casetab:
  1192. +       strout ("#<case-table ", -1, printcharfun);
  1193. +       goto etc_table;
  1194. +     case Lisp_Chartab:
  1195. +       strout ("#<char-table ", -1, printcharfun);
  1196. +       goto etc_table;
  1197. +     case Lisp_Sorttab:
  1198. +       strout ("#<sort-table ", -1, printcharfun);
  1199. +       goto etc_table;
  1200. +     case Lisp_Transtab:
  1201. +       strout ("#<trans-table ", -1, printcharfun);
  1202. +     etc_table:
  1203. +       sprintf (buf, "%d", XETCTAB (obj)->etc_ser);
  1204. +       strout (buf, -1, printcharfun);
  1205.         PRINTCHAR ('>');
  1206.         break;
  1207.   #endif /* standalone */
  1208.