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

  1. From: howard@hasse.ericsson.se (Howard Gayle)
  2. Newsgroups: alt.sources
  3. Subject: GNU Emacs 8-bit mods part 05 of 12
  4. Message-ID: <1990Apr5.133649.8863@ericsson.se>
  5. Date: 5 Apr 90 13:36:49 GMT
  6.  
  7. *** ../18.55/src/abbrev.c    Fri Dec  5 10:13:58 1986
  8. --- src/abbrev.c    Thu Apr  5 09:08:59 1990
  9. ***************
  10. *** 1,5 ****
  11.   /* Primitives for word-abbrev mode.
  12. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  13.   
  14.   This file is part of GNU Emacs.
  15.   
  16. --- 1,5 ----
  17.   /* Primitives for word-abbrev mode.
  18. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  19.   
  20.   This file is part of GNU Emacs.
  21.   
  22. ***************
  23. *** 19,30 ****
  24. --- 19,37 ----
  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 <stdio.h>
  32.   #undef NULL
  33.   #include "lisp.h"
  34. + #include "casetab.h"
  35. + #include "chartab.h"
  36.   #include "commands.h"
  37.   #include "buffer.h"
  38. + #include "transtab.h"
  39.   #include "window.h"
  40.   
  41.   /* An abbrev table is an obarray.
  42. ***************
  43. *** 222,228 ****
  44.         CHECK_NUMBER_COERCE_MARKER (tem, 0);
  45.         wordstart = XINT (tem);
  46.         Vabbrev_start_location = Qnil;
  47. !       if (CharAt (wordstart) == '-')
  48.       del_range (wordstart, wordstart + 1);
  49.       }
  50.     else
  51. --- 229,235 ----
  52.         CHECK_NUMBER_COERCE_MARKER (tem, 0);
  53.         wordstart = XINT (tem);
  54.         Vabbrev_start_location = Qnil;
  55. !       if (CharAt (wordstart) == HYPHEN)
  56.       del_range (wordstart, wordstart + 1);
  57.       }
  58.     else
  59. ***************
  60. *** 234,243 ****
  61.     for (idx = wordstart; idx < point; idx++)
  62.       {
  63.         register int c = CharAt (idx);
  64. !       if (UPPERCASEP (c))
  65. !     c = DOWNCASE (c), uccount++;
  66. !       else if (! NOCASEP (c))
  67. !     lccount++;
  68.         *p++ = c;
  69.       }
  70.   
  71. --- 241,256 ----
  72.     for (idx = wordstart; idx < point; idx++)
  73.       {
  74.         register int c = CharAt (idx);
  75. !       switch (LOCAL_CASE (c))
  76. !         {
  77. !       case lowercase_e:
  78. !         lccount++;
  79. !         break;
  80. !       case uppercase_e:
  81. !         c = LOCAL_TOLOWER (c);
  82. !         uccount++;
  83. !         break;
  84. !     }
  85.         *p++ = c;
  86.       }
  87.   
  88. *** ../18.55/src/alloc.c    Mon Feb 13 11:23:35 1989
  89. --- src/alloc.c    Thu Apr  5 09:08:58 1990
  90. ***************
  91. *** 1,5 ****
  92.   /* Storage allocation and gc for GNU Emacs Lisp interpreter.
  93. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  94.   
  95.   This file is part of GNU Emacs.
  96.   
  97. --- 1,5 ----
  98.   /* Storage allocation and gc for GNU Emacs Lisp interpreter.
  99. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  100.   
  101.   This file is part of GNU Emacs.
  102.   
  103. ***************
  104. *** 19,28 ****
  105. --- 19,33 ----
  106.   and this notice must be preserved on all copies.  */
  107.   
  108.   
  109. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  110. +  *  See chartab.c for details. */
  111.   #include "config.h"
  112.   #include "lisp.h"
  113.   #ifndef standalone
  114.   #include "buffer.h"
  115. + #include "etctab.h"
  116.   #include "window.h"
  117.   #endif
  118.   
  119. ***************
  120. *** 1058,1063 ****
  121. --- 1063,1081 ----
  122.       mark_buffer (obj);
  123.         break;
  124.   
  125. +     case Lisp_Casetab:
  126. +     case Lisp_Chartab:
  127. +     case Lisp_Sorttab:
  128. +     case Lisp_Transtab:
  129. +       {
  130. +     register struct Lisp_Etctab *ptr = XETCTAB (obj);
  131. +     register int mark = ptr->etc_ser;
  132. +     if (mark & ARRAY_MARK_FLAG) break;   /* Already marked */
  133. +     ptr->etc_ser |= ARRAY_MARK_FLAG; /* Else mark it */
  134. +       }
  135. +       break;
  136.       case Lisp_Int:
  137.       case Lisp_Void:
  138.       case Lisp_Subr:
  139. ***************
  140. *** 1095,1100 ****
  141. --- 1113,1138 ----
  142.     if (buffer->syntax_table_v)
  143.       mark_object (&tem);
  144.   
  145. +   XSET (tem, Lisp_Casetab, buffer->case_table_v);
  146. +   if (buffer->case_table_v)
  147. +     mark_object (&tem);
  148. +   XSET (tem, Lisp_Transtab, buffer->upcase_table_v);
  149. +   if (buffer->upcase_table_v)
  150. +     mark_object (&tem);
  151. +   XSET (tem, Lisp_Transtab, buffer->downcase_table_v);
  152. +   if (buffer->downcase_table_v)
  153. +     mark_object (&tem);
  154. +   XSET (tem, Lisp_Sorttab, buffer->case_distinct_table_v);
  155. +   if (buffer->case_distinct_table_v)
  156. +     mark_object (&tem);
  157. +   XSET (tem, Lisp_Sorttab, buffer->case_fold_table_v);
  158. +   if (buffer->case_fold_table_v)
  159. +     mark_object (&tem);
  160.     for (ptr = &buffer->name + 1;
  161.          (char *)ptr < (char *)buffer + sizeof (struct buffer);
  162.          ptr++)
  163. ***************
  164. *** 1228,1233 ****
  165. --- 1266,1292 ----
  166.       }
  167.     }
  168.   
  169. +   /* Free all unmarked etc tables */
  170. +   {
  171. +     register struct Lisp_Etctab *p = all_etc_tables, *prev = 0, *next = 0;
  172. +     while (p)
  173. +       if (!(p->etc_ser & ARRAY_MARK_FLAG))
  174. +     {
  175. +       if (prev)
  176. +         prev->etc_next = p->etc_next;
  177. +       else
  178. +         all_etc_tables = p->etc_next;
  179. +       next = p->etc_next;
  180. +       free (p);
  181. +       p = next;
  182. +     }
  183. +       else
  184. +     {
  185. +       p->etc_ser &= ~ARRAY_MARK_FLAG;
  186. +       prev = p, p = p->etc_next;
  187. +     }
  188. +   }
  189.   #endif standalone
  190.   
  191.     /* Free all unmarked vectors */
  192. *** ../18.55/src/buffer.c    Fri Jul 21 00:36:02 1989
  193. --- src/buffer.c    Thu Apr  5 09:08:55 1990
  194. ***************
  195. *** 1,5 ****
  196.   /* Buffer manipulation primitives for GNU Emacs.
  197. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  198.   
  199.   This file is part of GNU Emacs.
  200.   
  201. --- 1,5 ----
  202.   /* Buffer manipulation primitives for GNU Emacs.
  203. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  204.   
  205.   This file is part of GNU Emacs.
  206.   
  207. ***************
  208. *** 19,24 ****
  209. --- 19,28 ----
  210.   and this notice must be preserved on all copies.  */
  211.   
  212.   
  213. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  214. +  *  See chartab.c for details. */
  215.   #include <sys/param.h>
  216.   
  217.   #ifndef MAXPATHLEN
  218. ***************
  219. *** 31,36 ****
  220. --- 35,41 ----
  221.   #endif
  222.   #include "config.h"
  223.   #include "lisp.h"
  224. + #include "chartab.h"
  225.   #include "window.h"
  226.   #include "commands.h"
  227.   #include "buffer.h"
  228. ***************
  229. *** 257,263 ****
  230.     b->mode_name = QSFundamental;
  231.     b->minor_modes = Qnil;
  232.     b->syntax_table_v = XVECTOR (Vstandard_syntax_table);
  233.     /* Reset all per-buffer variables to their defaults.  */
  234.     b->local_var_alist = Qnil;
  235.     b->local_var_flags = 0;
  236. --- 262,272 ----
  237.     b->mode_name = QSFundamental;
  238.     b->minor_modes = Qnil;
  239.     b->syntax_table_v = XVECTOR (Vstandard_syntax_table);
  240. !   b->case_table_v = buffer_defaults.case_table_v;
  241. !   b->downcase_table_v = buffer_defaults.downcase_table_v;
  242. !   b->upcase_table_v = buffer_defaults.upcase_table_v;
  243. !   b->case_distinct_table_v = buffer_defaults.case_distinct_table_v;
  244. !   b->case_fold_table_v = buffer_defaults.case_fold_table_v;
  245.     /* Reset all per-buffer variables to their defaults.  */
  246.     b->local_var_alist = Qnil;
  247.     b->local_var_flags = 0;
  248. ***************
  249. *** 1090,1105 ****
  250.     /* real setup is done in loaddefs.el */
  251.     buffer_defaults.mode_line_format = build_string ("%-");
  252.     buffer_defaults.abbrev_mode = Qnil;
  253.     buffer_defaults.overwrite_mode = Qnil;
  254.     buffer_defaults.case_fold_search = Qt;
  255.     buffer_defaults.auto_fill_hook = Qnil;
  256.     buffer_defaults.selective_display = Qnil;
  257. -   buffer_defaults.selective_display_ellipses = Qt;
  258.     buffer_defaults.abbrev_table = Qnil;
  259.   
  260.     XFASTINT (buffer_defaults.tab_width) = 8;
  261.     buffer_defaults.truncate_lines = Qnil;
  262. -   buffer_defaults.ctl_arrow = Qt;
  263.   
  264.     XFASTINT (buffer_defaults.fill_column) = 70;
  265.     XFASTINT (buffer_defaults.left_margin) = 0;
  266. --- 1099,1113 ----
  267.     /* real setup is done in loaddefs.el */
  268.     buffer_defaults.mode_line_format = build_string ("%-");
  269.     buffer_defaults.abbrev_mode = Qnil;
  270. +   buffer_defaults.buffer_char_table = Vctl_arrow_char_table;
  271.     buffer_defaults.overwrite_mode = Qnil;
  272.     buffer_defaults.case_fold_search = Qt;
  273.     buffer_defaults.auto_fill_hook = Qnil;
  274.     buffer_defaults.selective_display = Qnil;
  275.     buffer_defaults.abbrev_table = Qnil;
  276.   
  277.     XFASTINT (buffer_defaults.tab_width) = 8;
  278.     buffer_defaults.truncate_lines = Qnil;
  279.   
  280.     XFASTINT (buffer_defaults.fill_column) = 70;
  281.     XFASTINT (buffer_defaults.left_margin) = 0;
  282. ***************
  283. *** 1129,1138 ****
  284.     XFASTINT (buffer_local_flags.case_fold_search) = 8;
  285.     XFASTINT (buffer_local_flags.auto_fill_hook) = 0x10;
  286.     XFASTINT (buffer_local_flags.selective_display) = 0x20;
  287. !   XFASTINT (buffer_local_flags.selective_display_ellipses) = 0x40;
  288.     XFASTINT (buffer_local_flags.tab_width) = 0x80;
  289.     XFASTINT (buffer_local_flags.truncate_lines) = 0x100;
  290. !   XFASTINT (buffer_local_flags.ctl_arrow) = 0x200;
  291.     XFASTINT (buffer_local_flags.fill_column) = 0x400;
  292.     XFASTINT (buffer_local_flags.left_margin) = 0x800;
  293.     XFASTINT (buffer_local_flags.abbrev_table) = 0x1000;
  294. --- 1137,1146 ----
  295.     XFASTINT (buffer_local_flags.case_fold_search) = 8;
  296.     XFASTINT (buffer_local_flags.auto_fill_hook) = 0x10;
  297.     XFASTINT (buffer_local_flags.selective_display) = 0x20;
  298. !   XFASTINT (buffer_local_flags.buffer_char_table) = 0x40;
  299.     XFASTINT (buffer_local_flags.tab_width) = 0x80;
  300.     XFASTINT (buffer_local_flags.truncate_lines) = 0x100;
  301. !   /* 0x200 unused. */
  302.     XFASTINT (buffer_local_flags.fill_column) = 0x400;
  303.     XFASTINT (buffer_local_flags.left_margin) = 0x800;
  304.     XFASTINT (buffer_local_flags.abbrev_table) = 0x1000;
  305. ***************
  306. *** 1204,1213 ****
  307.       "Default abbrev-mode for buffers that do not override it.\n\
  308.   This is the same as (default-value 'abbrev-mode).");
  309.   
  310. !   DEFVAR_LISP_NOPRO ("default-ctl-arrow",
  311. !           &buffer_defaults.ctl_arrow,
  312. !     "Default ctl-arrow for buffers that do not override it.\n\
  313. ! This is the same as (default-value 'ctl-arrow).");
  314.   
  315.     DEFVAR_LISP_NOPRO ("default-truncate-lines",
  316.             &buffer_defaults.truncate_lines,
  317. --- 1212,1221 ----
  318.       "Default abbrev-mode for buffers that do not override it.\n\
  319.   This is the same as (default-value 'abbrev-mode).");
  320.   
  321. !   DEFVAR_LISP_NOPRO ("default-buffer-char-table",
  322. !           &buffer_defaults.buffer_char_table,
  323. !     "Default char table for buffers that do not override it.\n\
  324. ! This is the same as (default-value 'buffer-char-table).");
  325.   
  326.     DEFVAR_LISP_NOPRO ("default-truncate-lines",
  327.             &buffer_defaults.truncate_lines,
  328. ***************
  329. *** 1276,1281 ****
  330. --- 1284,1293 ----
  331.       "Non-nil turns on automatic expansion of abbrevs when inserted.\n\
  332.   Automatically becomes local when set in any fashion.");
  333.   
  334. +   DEFVAR_PER_BUFFER ("buffer-char-table", &bf_cur->buffer_char_table,
  335. +     "Use this char table when displaying buffer.\n\
  336. + Automatically becomes local when set in any fashion.");
  337.     DEFVAR_PER_BUFFER ("case-fold-search", &bf_cur->case_fold_search,
  338.       "*Non-nil if searches should ignore case.\n\
  339.   Automatically becomes local when set in any fashion.");
  340. ***************
  341. *** 1296,1306 ****
  342.       "*Distance between tab stops (for display of tab characters), in columns.\n\
  343.   Automatically becomes local when set in any fashion.");
  344.   
  345. -   DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow,
  346. -     "*Non-nil means display control chars with uparrow.\n\
  347. - Nil means use backslash and octal digits.\n\
  348. - Automatically becomes local when set in any fashion.");
  349.     DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines,
  350.       "*Non-nil means do not display continuation lines;\n\
  351.   give each line of text one screen line.\n\
  352. --- 1308,1313 ----
  353. ***************
  354. *** 1341,1351 ****
  355.    ^M's in the file are written into files as newlines.\n\
  356.   Integer n as value means display only lines\n\
  357.    that start with less than n columns of space.\n\
  358. - Automatically becomes local when set in any fashion.");
  359. -   DEFVAR_PER_BUFFER ("selective-display-ellipses",
  360. -             &bf_cur->selective_display_ellipses,
  361. -     "t means display ... on previous line when a line is invisible.\n\
  362.   Automatically becomes local when set in any fashion.");
  363.   
  364.     DEFVAR_PER_BUFFER ("overwrite-mode", &bf_cur->overwrite_mode,
  365. --- 1348,1353 ----
  366. *** ../18.55/src/buffer.h    Sun Feb  8 15:35:54 1987
  367. --- src/buffer.h    Thu Apr  5 09:09:17 1990
  368. ***************
  369. *** 1,5 ****
  370.   /* Header file for the buffer manipulation primitives.
  371. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  372.   
  373.   This file is part of GNU Emacs.
  374.   
  375. --- 1,5 ----
  376.   /* Header file for the buffer manipulation primitives.
  377. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  378.   
  379.   This file is part of GNU Emacs.
  380.   
  381. ***************
  382. *** 19,24 ****
  383. --- 19,28 ----
  384.   and this notice must be preserved on all copies.  */
  385.   
  386.   
  387. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  388. +  *  See chartab.c for details. */
  389.   #ifdef lint
  390.   #include "undo.h"
  391.   #endif /* lint */
  392. ***************
  393. *** 74,79 ****
  394. --- 78,96 ----
  395.       struct UndoData *undodata;
  396.       /* the syntax table in use */
  397.       struct Lisp_Vector *syntax_table_v;
  398. +     /* The following 5 tables are implemented as Lisp strings.
  399. +     For speed, the pointers to the contents are here.  The Lisp
  400. +     objects reappear below for garbage collection. */
  401. +     /* The case table in use: */
  402. +     struct Lisp_Casetab *case_table_v;
  403. +     /* The lower case conversion table. */
  404. +     struct Lisp_Transtab *downcase_table_v;
  405. +     /* The upper case conversion table. */
  406. +     struct Lisp_Transtab *upcase_table_v;
  407. +     /* The translate table when case-fold-search is nil. */
  408. +     struct Lisp_Sorttab *case_distinct_table_v;
  409. +     /* The translate table when case-fold-search is not nil. */
  410. +     struct Lisp_Sorttab *case_fold_table_v;
  411.   
  412.       /* This is a special exception -- as this slot should not be
  413.          marked by gc_sweep, and as it is not lisp-accessible as
  414. ***************
  415. *** 135,152 ****
  416.       Lisp_Object tab_width;
  417.       Lisp_Object fill_column;
  418.       Lisp_Object left_margin;
  419. !     /* Function to call when insert space past fiull column */
  420.       Lisp_Object auto_fill_hook;
  421.   
  422.       /* Non-nil means do not display continuation lines */
  423.       Lisp_Object truncate_lines;
  424. -     /* Non-nil means display ctl chars with uparrow */
  425. -     Lisp_Object ctl_arrow;
  426.       /* Non-nil means do selective display;
  427.          See doc string in syms_of_buffer (buffer.c) for details.  */
  428.       Lisp_Object selective_display;
  429. -     /* Non-nil means show ... at end of line followed by invisible lines.  */
  430. -     Lisp_Object selective_display_ellipses;
  431.       /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
  432.       Lisp_Object minor_modes;
  433.       /* t if "self-insertion" should overwrite */
  434. --- 152,165 ----
  435.       Lisp_Object tab_width;
  436.       Lisp_Object fill_column;
  437.       Lisp_Object left_margin;
  438. !     /* Function to call when insert space past full column */
  439.       Lisp_Object auto_fill_hook;
  440.   
  441.       /* Non-nil means do not display continuation lines */
  442.       Lisp_Object truncate_lines;
  443.       /* Non-nil means do selective display;
  444.          See doc string in syms_of_buffer (buffer.c) for details.  */
  445.       Lisp_Object selective_display;
  446.       /* Alist of (FUNCTION . STRING) for each minor mode enabled in buffer. */
  447.       Lisp_Object minor_modes;
  448.       /* t if "self-insertion" should overwrite */
  449. ***************
  450. *** 153,158 ****
  451. --- 166,173 ----
  452.       Lisp_Object overwrite_mode;
  453.       /* non-nil means abbrev mode is on.  Expand abbrevs automatically. */
  454.       Lisp_Object abbrev_mode;
  455. +     /* Non-nil means use this char table instead of the default. */
  456. +     Lisp_Object buffer_char_table;
  457.   };
  458.   
  459.   extern struct buffer *bf_cur;        /* points to the current buffer */
  460. *** ../18.55/src/casefiddle.c    Sat Aug 15 02:03:10 1987
  461. --- src/casefiddle.c    Thu Apr  5 09:09:30 1990
  462. ***************
  463. *** 1,5 ****
  464.   /* GNU Emacs case conversion functions.
  465. !    Copyright (C) 1985 Free Software Foundation, Inc.
  466.   
  467.   This file is part of GNU Emacs.
  468.   
  469. --- 1,5 ----
  470.   /* GNU Emacs case conversion functions.
  471. !    Copyright (C) 1985, 1990 Free Software Foundation, Inc.
  472.   
  473.   This file is part of GNU Emacs.
  474.   
  475. ***************
  476. *** 19,29 ****
  477. --- 19,35 ----
  478.   and this notice must be preserved on all copies.  */
  479.   
  480.   
  481. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  482. +  *  See chartab.c for details. */
  483.   #include "config.h"
  484.   #include "lisp.h"
  485.   #include "buffer.h"
  486. + #include "casetab.h"
  487.   #include "commands.h"
  488.   #include "syntax.h"
  489. + #include "transtab.h"
  490.   
  491.   enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
  492.   
  493. ***************
  494. *** 42,51 ****
  495.         c = XINT (obj);
  496.         if (c >= 0 && c <= 0400)
  497.           {
  498. !           if (inword)
  499. !         XFASTINT (obj) = DOWNCASE (c);
  500. !           else if (!UPPERCASEP (c))
  501. !         XFASTINT (obj) = UPCASE1 (c);
  502.           }
  503.         return obj;
  504.       }
  505. --- 48,55 ----
  506.         c = XINT (obj);
  507.         if (c >= 0 && c <= 0400)
  508.           {
  509. !           XFASTINT (obj) = (inword ? LOCAL_TOLOWER (c)
  510. !                                                : LOCAL_TOUPPER (c));
  511.           }
  512.         return obj;
  513.       }
  514. ***************
  515. *** 56,65 ****
  516.         for (i = 0; i < len; i++)
  517.           {
  518.             c = XSTRING (obj)->data[i];
  519. !           if (inword)
  520. !         c = DOWNCASE (c);
  521. !           else if (!UPPERCASEP (c))
  522. !         c = UPCASE1 (c);
  523.             XSTRING (obj)->data[i] = c;
  524.             if (flag == CASE_CAPITALIZE)
  525.           inword = SYNTAX (c) == Sword;
  526. --- 60,66 ----
  527.         for (i = 0; i < len; i++)
  528.           {
  529.             c = XSTRING (obj)->data[i];
  530. !           c = (inword ? LOCAL_TOLOWER (c) : LOCAL_TOUPPER (c));
  531.             XSTRING (obj)->data[i] = c;
  532.             if (flag == CASE_CAPITALIZE)
  533.           inword = SYNTAX (c) == Sword;
  534. ***************
  535. *** 114,124 ****
  536.       {
  537.         c = CharAt (i);
  538.         if (inword && flag != CASE_CAPITALIZE_UP)
  539. !     c = DOWNCASE (c);
  540. !       else if (!UPPERCASEP (c)
  541. !            && (!inword || flag != CASE_CAPITALIZE_UP))
  542. !     c = UPCASE1 (c);
  543. !       CharAt (i) = c;
  544.         if ((int) flag >= (int) CASE_CAPITALIZE)
  545.       inword = SYNTAX (c) == Sword;
  546.       }
  547. --- 115,123 ----
  548.       {
  549.         c = CharAt (i);
  550.         if (inword && flag != CASE_CAPITALIZE_UP)
  551. !     CharAt (i) = LOCAL_TOLOWER (c);
  552. !       else if (!inword || flag != CASE_CAPITALIZE_UP)
  553. !     CharAt (i) = LOCAL_TOUPPER (c);
  554.         if ((int) flag >= (int) CASE_CAPITALIZE)
  555.       inword = SYNTAX (c) == Sword;
  556.       }
  557. *** ../18.55/src/config.h-dist    Thu Apr 21 10:18:33 1988
  558. --- src/config.h-dist    Thu Apr  5 09:09:50 1990
  559. ***************
  560. *** 1,5 ****
  561.   /* GNU Emacs site configuration template file.
  562. !    Copyright (C) 1988 Free Software Foundation, Inc.
  563.   
  564.   This file is part of GNU Emacs.
  565.   
  566. --- 1,5 ----
  567.   /* GNU Emacs site configuration template file.
  568. !    Copyright (C) 1988, 1990 Free Software Foundation, Inc.
  569.   
  570.   This file is part of GNU Emacs.
  571.   
  572. ***************
  573. *** 19,25 ****
  574. --- 19,29 ----
  575.   and this notice must be preserved on all copies.  */
  576.   
  577.   
  578. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  579. +  *  See chartab.c for details. */
  580.   
  581.   /* Include here a s- file that describes the system type you are using.
  582.      See the file ../etc/MACHINES for a list of systems and
  583.      the names of the s- files to use for them.
  584. ***************
  585. *** 101,109 ****
  586.   
  587.   #ifndef PURESIZE
  588.   #ifdef HAVE_X_WINDOWS
  589. ! #define PURESIZE 122000
  590.   #else
  591. ! #define PURESIZE 118000
  592.   #endif
  593.   #endif
  594.   
  595. --- 105,113 ----
  596.   
  597.   #ifndef PURESIZE
  598.   #ifdef HAVE_X_WINDOWS
  599. ! #define PURESIZE 152000
  600.   #else
  601. ! #define PURESIZE 148000
  602.   #endif
  603.   #endif
  604.   
  605. *** ../18.55/src/cmds.c    Thu Dec 29 05:09:21 1988
  606. --- src/cmds.c    Thu Apr  5 09:10:08 1990
  607. ***************
  608. *** 1,5 ****
  609.   /* Simple built-in editing commands.
  610. !    Copyright (C) 1985 Free Software Foundation, Inc.
  611.   
  612.   This file is part of GNU Emacs.
  613.   
  614. --- 1,5 ----
  615.   /* Simple built-in editing commands.
  616. !    Copyright (C) 1985, 1990 Free Software Foundation, Inc.
  617.   
  618.   This file is part of GNU Emacs.
  619.   
  620. ***************
  621. *** 19,26 ****
  622. --- 19,31 ----
  623.   and this notice must be preserved on all copies.  */
  624.   
  625.   
  626. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  627. +  *  See chartab.c for details. */
  628.   #include "config.h"
  629.   #include "lisp.h"
  630. + #include "chartab.h"
  631.   #include "commands.h"
  632.   #include "buffer.h"
  633.   #include "syntax.h"
  634. ***************
  635. *** 90,100 ****
  636.       }
  637.   
  638.     negp = count <= 0;
  639. !   pos = scan_buffer ('\n', pos2, count - negp, &shortage);
  640.     if (shortage > 0
  641.         && (negp
  642.         || (NumCharacters >= FirstCharacter
  643. !           && CharAt (pos - 1) != '\n')))
  644.       shortage--;
  645.     SetPoint (pos);
  646.     return make_number (negp ? - shortage : shortage);
  647. --- 95,105 ----
  648.       }
  649.   
  650.     negp = count <= 0;
  651. !   pos = scan_buffer (NEWLINE, pos2, count - negp, &shortage);
  652.     if (shortage > 0
  653.         && (negp
  654.         || (NumCharacters >= FirstCharacter
  655. !           && CharAt (pos - 1) != NEWLINE)))
  656.       shortage--;
  657.     SetPoint (pos);
  658.     return make_number (negp ? - shortage : shortage);
  659. ***************
  660. *** 138,144 ****
  661.   
  662.     pos = point;
  663.     stop = NumCharacters + 1;
  664. !   while (pos < stop && CharAt (pos) != '\n') pos++;
  665.     SetPoint (pos);
  666.   
  667.     return Qnil;
  668. --- 143,149 ----
  669.   
  670.     pos = point;
  671.     stop = NumCharacters + 1;
  672. !   while (pos < stop && CharAt (pos) != NEWLINE) pos++;
  673.     SetPoint (pos);
  674.   
  675.     return Qnil;
  676. ***************
  677. *** 214,220 ****
  678.   {
  679.     int flag;
  680.     Lisp_Object arg;
  681. !   char c1 = '\n';
  682.   
  683.     arg = Fprefix_numeric_value (arg1);
  684.   
  685. --- 219,225 ----
  686.   {
  687.     int flag;
  688.     Lisp_Object arg;
  689. !   char c1 = NEWLINE;
  690.   
  691.     arg = Fprefix_numeric_value (arg1);
  692.   
  693. ***************
  694. *** 229,235 ****
  695.        Must avoid SelfInsert in that case since point is wrong.
  696.        Luckily SelfInsert's special features all do nothing in that case.  */
  697.   
  698. !   flag = point > FirstCharacter && CharAt (point - 1) == '\n';
  699.     if (flag) PointLeft (1);
  700.   
  701.     while (XINT (arg) > 0)
  702. --- 234,240 ----
  703.        Must avoid SelfInsert in that case since point is wrong.
  704.        Luckily SelfInsert's special features all do nothing in that case.  */
  705.   
  706. !   flag = point > FirstCharacter && CharAt (point - 1) == NEWLINE;
  707.     if (flag) PointLeft (1);
  708.   
  709.     while (XINT (arg) > 0)
  710. ***************
  711. *** 237,243 ****
  712.         if (flag)
  713.       InsCStr (&c1, 1);
  714.         else
  715. !     SelfInsert ('\n', !NULL (arg1));
  716.         XFASTINT (arg)--;        /* Ok since old and new vals both nonneg */
  717.       }
  718.   
  719. --- 242,248 ----
  720.         if (flag)
  721.       InsCStr (&c1, 1);
  722.         else
  723. !     SelfInsert (NEWLINE, !NULL (arg1));
  724.         XFASTINT (arg)--;        /* Ok since old and new vals both nonneg */
  725.       }
  726.   
  727. ***************
  728. *** 258,265 ****
  729.   
  730.     if (!NULL (bf_cur->overwrite_mode)
  731.         && point <= NumCharacters
  732. !       && c != '\n' && CharAt (point) != '\n'
  733. !       && (CharAt (point) != '\t'
  734.         || XINT (bf_cur->tab_width) <= 0
  735.         || !((current_column () + 1) % XFASTINT (bf_cur->tab_width))))
  736.       {
  737. --- 263,270 ----
  738.   
  739.     if (!NULL (bf_cur->overwrite_mode)
  740.         && point <= NumCharacters
  741. !       && c != NEWLINE && CharAt (point) != NEWLINE
  742. !       && (CharAt (point) != HTAB
  743.         || XINT (bf_cur->tab_width) <= 0
  744.         || !((current_column () + 1) % XFASTINT (bf_cur->tab_width))))
  745.       {
  746. ***************
  747. *** 275,289 ****
  748.         if (!NULL (tem))
  749.       hairy = 1;
  750.       }
  751. !   if ((c == ' ' || c == '\n')
  752.         && !noautofill
  753.         && !NULL (bf_cur->auto_fill_hook)
  754.         && current_column () > XFASTINT (bf_cur->fill_column))
  755.       {
  756. !       if (c1 != '\n')
  757.       InsCStr (&c1, 1);
  758.         call0 (bf_cur->auto_fill_hook);
  759. !       if (c1 == '\n')
  760.       InsCStr (&c1, 1);
  761.         hairy = 1;
  762.       }
  763. --- 280,294 ----
  764.         if (!NULL (tem))
  765.       hairy = 1;
  766.       }
  767. !   if ((c == ' ' || c == NEWLINE)
  768.         && !noautofill
  769.         && !NULL (bf_cur->auto_fill_hook)
  770.         && current_column () > XFASTINT (bf_cur->fill_column))
  771.       {
  772. !       if (c1 != NEWLINE)
  773.       InsCStr (&c1, 1);
  774.         call0 (bf_cur->auto_fill_hook);
  775. !       if (c1 == NEWLINE)
  776.       InsCStr (&c1, 1);
  777.         hairy = 1;
  778.       }
  779. *** ../18.55/src/data.c    Sat Feb 11 07:15:57 1989
  780. --- src/data.c    Thu Apr  5 09:10:21 1990
  781. ***************
  782. *** 1,5 ****
  783.   /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
  784. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  785.   
  786.   This file is part of GNU Emacs.
  787.   
  788. --- 1,5 ----
  789.   /* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
  790. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  791.   
  792.   This file is part of GNU Emacs.
  793.   
  794. ***************
  795. *** 19,24 ****
  796. --- 19,28 ----
  797.   and this notice must be preserved on all copies.  */
  798.   
  799.   
  800. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  801. +  *  See chartab.c for details. */
  802.   #include <signal.h>
  803.   
  804.   #include "config.h"
  805. ***************
  806. *** 67,72 ****
  807. --- 71,84 ----
  808.   pure_write_error ()
  809.   {
  810.     error ("Attempt to modify read-only object");
  811. + }
  812. + void
  813. + arg_out_of_range (a1)
  814. +      Lisp_Object a1;
  815. + {
  816. +   while (1)
  817. +     Fsignal (Qargs_out_of_range, Fcons (a1, Qnil));
  818.   }
  819.   
  820.   void
  821. *** ../18.55/src/dired.c    Sun Apr 10 13:17:54 1988
  822. --- src/dired.c    Thu Apr  5 09:10:40 1990
  823. ***************
  824. *** 1,5 ****
  825.   /* Lisp functions for making directory listings.
  826. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  827.   
  828.   This file is part of GNU Emacs.
  829.   
  830. --- 1,5 ----
  831.   /* Lisp functions for making directory listings.
  832. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  833.   
  834.   This file is part of GNU Emacs.
  835.   
  836. ***************
  837. *** 19,24 ****
  838. --- 19,28 ----
  839.   and this notice must be preserved on all copies.  */
  840.   
  841.   
  842. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  843. +  *  See chartab.c for details. */
  844.   #include <stdio.h>
  845.   #include <sys/types.h>
  846.   #include <sys/stat.h>
  847. ***************
  848. *** 54,59 ****
  849. --- 58,64 ----
  850.   #include "commands.h"
  851.   
  852.   #include "regex.h"
  853. + #include "sorttab.h"
  854.   
  855.   #define min(a, b) ((a) < (b) ? (a) : (b))
  856.   
  857. ***************
  858. *** 89,97 ****
  859.         CHECK_STRING (match, 3);
  860.         /* Compile it now so we don't get an error after opendir */
  861.   #ifdef VMS
  862. !       compile_pattern (match, &searchbuf, (char *) downcase_table);
  863.   #else
  864. !       compile_pattern (match, &searchbuf, 0);
  865.   #endif
  866.       }
  867.   
  868. --- 94,102 ----
  869.         CHECK_STRING (match, 3);
  870.         /* Compile it now so we don't get an error after opendir */
  871.   #ifdef VMS
  872. !       compile_pattern (match, &searchbuf, buffer_defaults.case_fold_table_v);
  873.   #else
  874. !       compile_pattern (match, &searchbuf, NULL_SORT_TABLE);
  875.   #endif
  876.       }
  877.   
  878. *** ../18.55/src/dispextern.h    Thu Dec 11 05:39:55 1986
  879. --- src/dispextern.h    Thu Apr  5 09:10:54 1990
  880. ***************
  881. *** 1,5 ****
  882.   /* Interface definitions for display code.
  883. !    Copyright (C) 1985 Free Software Foundation, Inc.
  884.   
  885.   This file is part of GNU Emacs.
  886.   
  887. --- 1,5 ----
  888.   /* Interface definitions for display code.
  889. !    Copyright (C) 1985, 1990 Free Software Foundation, Inc.
  890.   
  891.   This file is part of GNU Emacs.
  892.   
  893. ***************
  894. *** 19,24 ****
  895. --- 19,28 ----
  896.   and this notice must be preserved on all copies.  */
  897.   
  898.   
  899. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  900. +  *  See chartab.c for details. */
  901.   /* Nonzero means do not assume anything about current
  902.    contents of actual terminal screen */
  903.   
  904. ***************
  905. *** 59,68 ****
  906.   struct display_line
  907.     {
  908.       struct display_line *next;    /* Chain for free lines. */
  909. !     short   length;        /* the number of valid characters in body */
  910.       char    highlighted;    /* 1 means write this line in standout mode */
  911.       char    physical;        /* Mark bit for gc'ing, in update_screen */
  912. !     char    body[MScreenWidth + 4];    /* the actual text of the line */
  913.   };
  914.   
  915.   /* Allocate a line structure for screen line `vpos' (origin 0)
  916. --- 63,72 ----
  917.   struct display_line
  918.     {
  919.       struct display_line *next;    /* Chain for free lines. */
  920. !     short   length;        /* the number of valid glyfs in body */
  921.       char    highlighted;    /* 1 means write this line in standout mode */
  922.       char    physical;        /* Mark bit for gc'ing, in update_screen */
  923. !     glyf_t  body[MScreenWidth + 4];    /* the actual text of the line */
  924.   };
  925.   
  926.   /* Allocate a line structure for screen line `vpos' (origin 0)
  927. *** ../18.55/src/dispnew.c    Sat Aug 12 18:30:37 1989
  928. --- src/dispnew.c    Thu Apr  5 09:11:07 1990
  929. ***************
  930. *** 1,5 ****
  931.   /* Newly written part of redisplay code.
  932. !    Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
  933.   
  934.   This file is part of GNU Emacs.
  935.   
  936. --- 1,5 ----
  937.   /* Newly written part of redisplay code.
  938. !    Copyright (C) 1985, 1986, 1987, 1988, 1990 Free Software Foundation, Inc.
  939.   
  940.   This file is part of GNU Emacs.
  941.   
  942. ***************
  943. *** 19,24 ****
  944. --- 19,28 ----
  945.   and this notice must be preserved on all copies.  */
  946.   
  947.   
  948. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  949. +  *  See chartab.c for details. */
  950.   #include <signal.h>
  951.   
  952.   #include "config.h"
  953. ***************
  954. *** 55,63 ****
  955.   #include "termchar.h"
  956.   #include "termopts.h"
  957.   #include "cm.h"
  958. - #include "dispextern.h"
  959.   #include "lisp.h"
  960.   #include "buffer.h"
  961.   #include "window.h"
  962.   #include "commands.h"
  963.   
  964. --- 59,68 ----
  965.   #include "termchar.h"
  966.   #include "termopts.h"
  967.   #include "cm.h"
  968.   #include "lisp.h"
  969. + #include "dispextern.h"
  970.   #include "buffer.h"
  971. + #include "chartab.h"
  972.   #include "window.h"
  973.   #include "commands.h"
  974.   
  975. ***************
  976. *** 178,184 ****
  977.   
  978.     for (i = - screen_height; i < screen_height; i++)
  979.       {
  980. !       p = (struct display_line *) malloc (sizeof (struct display_line) + screen_width - MScreenWidth);
  981.         if (!p) abort ();
  982.         SET_LINE_NEXT (p, free_display_lines);
  983.         free_display_lines = p;
  984. --- 183,191 ----
  985.   
  986.     for (i = - screen_height; i < screen_height; i++)
  987.       {
  988. !       p = (struct display_line *) malloc (
  989. !          sizeof (struct display_line) +
  990. !          (screen_width - MScreenWidth) * sizeof (glyf_t));
  991.         if (!p) abort ();
  992.         SET_LINE_NEXT (p, free_display_lines);
  993.         free_display_lines = p;
  994. ***************
  995. *** 201,207 ****
  996.       abort ();
  997.     free_display_lines = LINE_NEXT (p);
  998.   
  999. !   bzero (p, p->body - (char *) p);
  1000.     SET_LINE_NEXT (p, (struct display_line *)1);    /* Mark as in use.  */
  1001.     free_line_count--;
  1002.     return p;
  1003. --- 208,214 ----
  1004.       abort ();
  1005.     free_display_lines = LINE_NEXT (p);
  1006.   
  1007. !   bzero (p, (char *) p->body - (char *) p);
  1008.     SET_LINE_NEXT (p, (struct display_line *)1);    /* Mark as in use.  */
  1009.     free_line_count--;
  1010.     return p;
  1011. ***************
  1012. *** 234,240 ****
  1013.   line_hash_code (p)
  1014.        register struct display_line *p;
  1015.   {
  1016. !   register char *body, *end;
  1017.     register int h = 0;
  1018.     if (!p)
  1019.       return 0;
  1020. --- 241,247 ----
  1021.   line_hash_code (p)
  1022.        register struct display_line *p;
  1023.   {
  1024. !   register glyf_t *body, *end;
  1025.     register int h = 0;
  1026.     if (!p)
  1027.       return 0;
  1028. ***************
  1029. *** 248,258 ****
  1030.     *end = 0;
  1031.     if (!must_write_spaces)
  1032.       {
  1033. !       while (*body++ == ' ');
  1034.         body--;
  1035.         if (body == end)
  1036.       return 1;
  1037. !       while (end[-1] == ' ') end--;
  1038.       }
  1039.     while (body != end)
  1040.       h = (h << 5) + h + *body++;
  1041. --- 255,265 ----
  1042.     *end = 0;
  1043.     if (!must_write_spaces)
  1044.       {
  1045. !       while (*body++ == SPACEGLYF);
  1046.         body--;
  1047.         if (body == end)
  1048.       return 1;
  1049. !       while (end[-1] == SPACEGLYF) end--;
  1050.       }
  1051.     while (body != end)
  1052.       h = (h << 5) + h + *body++;
  1053. ***************
  1054. *** 261,267 ****
  1055.     return 1;
  1056.   }
  1057.   
  1058. ! /* Return number of characters in display_line p,
  1059.      except don't count leading and trailing spaces
  1060.      unless the terminal requires those to be explicitly output.  */
  1061.   
  1062. --- 268,274 ----
  1063.     return 1;
  1064.   }
  1065.   
  1066. ! /* Return number of characters to draw display_line p,
  1067.      except don't count leading and trailing spaces
  1068.      unless the terminal requires those to be explicitly output.  */
  1069.   
  1070. ***************
  1071. *** 268,287 ****
  1072.   line_draw_cost (p)
  1073.        struct display_line *p;
  1074.   {
  1075. !   register char *body;
  1076.     register int i;
  1077.   
  1078.     if (!p)
  1079.       return 0;
  1080.   
  1081. !   if (must_write_spaces)
  1082. !     return p->length;
  1083. !   body = p->body - 1;
  1084. !   for (i = p->length; i > 0 && body[i - 1] == ' '; i--);
  1085. !   i -= count_blanks (p->body);
  1086. !   return max (i, 0);
  1087.   }
  1088.   
  1089.   /* The functions on this page are the interface from xdisp.c to redisplay.
  1090. --- 275,301 ----
  1091.   line_draw_cost (p)
  1092.        struct display_line *p;
  1093.   {
  1094. !   register glyf_t *body;
  1095. !   register glyf_t *end;
  1096.     register int i;
  1097.   
  1098.     if (!p)
  1099.       return 0;
  1100.   
  1101. !   body = p->body;
  1102. !   end = body + p->length - 1;
  1103. !   if (!must_write_spaces)
  1104. !     {
  1105. !       while ((*end == SPACEGLYF) && (end != body))
  1106. !          --end;
  1107. !       if (end == body) return (0); /* All blank line. */
  1108. !       while (*body == SPACEGLYF)
  1109. !          ++body;
  1110. !     }
  1111. !   i = 0;
  1112. !   while ((body <= end) && *body)
  1113. !     i += glyf_len (*body++);
  1114. !   return (i);
  1115.   }
  1116.   
  1117.   /* The functions on this page are the interface from xdisp.c to redisplay.
  1118. ***************
  1119. *** 308,314 ****
  1120.        register int hpos;
  1121.   {
  1122.     register struct display_line *line;
  1123. !   register char *p;
  1124.   
  1125.     if (vpos < 0) abort ();
  1126.   
  1127. --- 322,328 ----
  1128.        register int hpos;
  1129.   {
  1130.     register struct display_line *line;
  1131. !   register glyf_t *p;
  1132.   
  1133.     if (vpos < 0) abort ();
  1134.   
  1135. ***************
  1136. *** 324,330 ****
  1137.         hpos -= line->length;
  1138.         line->length += hpos;
  1139.         while (--hpos >= 0)
  1140. !     *p++ = ' ';
  1141.       }
  1142.   
  1143.     DesiredScreen[vpos + 1] = line;
  1144. --- 338,344 ----
  1145.         hpos -= line->length;
  1146.         line->length += hpos;
  1147.         while (--hpos >= 0)
  1148. !     *p++ = SPACEGLYF;
  1149.       }
  1150.   
  1151.     DesiredScreen[vpos + 1] = line;
  1152. ***************
  1153. *** 401,407 ****
  1154.       {
  1155.         if (start > 0)
  1156.           {
  1157. !           bcopy (l2->body, l1->body, start);
  1158.             if (l1->length < start && l1->length < l2->length)
  1159.           l1->length = min (start, l2->length);
  1160.           }
  1161. --- 415,421 ----
  1162.       {
  1163.         if (start > 0)
  1164.           {
  1165. !           bcopy (l2->body, l1->body, start * sizeof (glyf_t));
  1166.             if (l1->length < start && l1->length < l2->length)
  1167.           l1->length = min (start, l2->length);
  1168.           }
  1169. ***************
  1170. *** 408,415 ****
  1171.         if (l2->length > end && l1->length < l2->length)
  1172.           {
  1173.             while (l1->length < end)
  1174. !         l1->body[l1->length++] = ' ';
  1175. !           bcopy (l2->body + end, l1->body + end, l2->length - end);
  1176.             l1->length = l2->length;
  1177.           }
  1178.       }
  1179. --- 422,430 ----
  1180.         if (l2->length > end && l1->length < l2->length)
  1181.           {
  1182.             while (l1->length < end)
  1183. !         l1->body[l1->length++] = SPACEGLYF;
  1184. !           bcopy (l2->body + end, l1->body + end,
  1185. !                      (l2->length - end) * sizeof (glyf_t));
  1186.             l1->length = l2->length;
  1187.           }
  1188.       }
  1189. ***************
  1190. *** 444,451 ****
  1191.             fin = l2->length;
  1192.             if (fin > end) fin = end;
  1193.             while (l1->length < start)
  1194. !         l1->body[l1->length++] = ' ';
  1195. !           bcopy (l2->body + start, l1->body + start, fin - start);
  1196.             l1->length = fin;
  1197.           }
  1198.       }
  1199. --- 459,467 ----
  1200.             fin = l2->length;
  1201.             if (fin > end) fin = end;
  1202.             while (l1->length < start)
  1203. !         l1->body[l1->length++] = SPACEGLYF;
  1204. !           bcopy (l2->body + start, l1->body + start,
  1205. !                      (fin - start) * sizeof (glyf_t));
  1206.             l1->length = fin;
  1207.           }
  1208.       }
  1209. ***************
  1210. *** 484,491 ****
  1211.      see command_loop_1 where these are called.  */
  1212.   
  1213.   int
  1214. ! direct_output_for_insert (c)
  1215. !      int c;
  1216.   {
  1217.     register struct display_line *p = PhysScreen[cursY + 1];
  1218.   #ifndef COMPILER_REGISTER_BUG
  1219. --- 500,507 ----
  1220.      see command_loop_1 where these are called.  */
  1221.   
  1222.   int
  1223. ! direct_output_for_insert (g)
  1224. !      glyf_t g;
  1225.   {
  1226.     register struct display_line *p = PhysScreen[cursY + 1];
  1227.   #ifndef COMPILER_REGISTER_BUG
  1228. ***************
  1229. *** 514,520 ****
  1230.         || EQ (selected_window, minibuf_window) && minibuf_message)
  1231.       return 0;
  1232.   
  1233. !   p->body[hpos] = c;
  1234.     unchanged_modified = bf_modified;
  1235.     beg_unchanged = bf_s1;
  1236.     XFASTINT (w->last_point) = point;
  1237. --- 530,536 ----
  1238.         || EQ (selected_window, minibuf_window) && minibuf_message)
  1239.       return 0;
  1240.   
  1241. !   p->body[hpos] = g;
  1242.     unchanged_modified = bf_modified;
  1243.     beg_unchanged = bf_s1;
  1244.     XFASTINT (w->last_point) = point;
  1245. ***************
  1246. *** 522,528 ****
  1247.     XFASTINT (w->last_modified) = bf_modified;
  1248.   
  1249.     reassert_line_highlight (0, cursY);
  1250. !   write_chars (p->body + hpos, 1);
  1251.     fflush (stdout);
  1252.     ++cursX;
  1253.     p->length = max (p->length, cursX);
  1254. --- 538,544 ----
  1255.     XFASTINT (w->last_modified) = bf_modified;
  1256.   
  1257.     reassert_line_highlight (0, cursY);
  1258. !   write_glyfs (p->body + hpos, 1);
  1259.     fflush (stdout);
  1260.     ++cursX;
  1261.     p->length = max (p->length, cursX);
  1262. ***************
  1263. *** 787,796 ****
  1264.        struct display_line *old, *new;
  1265.        int vpos;
  1266.   {
  1267. !   register char *obody, *nbody, *op1, *op2, *np1;
  1268.     int tem;
  1269.     int osp, nsp, m1, m2, olen, nlen;
  1270. !   int save;
  1271.   
  1272.     if (old == new)
  1273.       return;
  1274. --- 803,812 ----
  1275.        struct display_line *old, *new;
  1276.        int vpos;
  1277.   {
  1278. !   register glyf_t *obody, *nbody, *op1, *op2, *np1;
  1279.     int tem;
  1280.     int osp, nsp, m1, m2, olen, nlen;
  1281. !   glyf_t save;
  1282.   
  1283.     if (old == new)
  1284.       return;
  1285. ***************
  1286. *** 816,824 ****
  1287.         olen = old->length;
  1288.         if (! old->highlighted)
  1289.       {
  1290. -       /* Note obody[-1] is old->physical, which is always 0 or 1.  */
  1291.         if (!must_write_spaces)
  1292. !         while (obody[olen - 1] == ' ')
  1293.             olen--;
  1294.       }
  1295.         else
  1296. --- 832,839 ----
  1297.         olen = old->length;
  1298.         if (! old->highlighted)
  1299.       {
  1300.         if (!must_write_spaces)
  1301. !         while ((obody[olen - 1] == SPACEGLYF) && (0 != olen))
  1302.             olen--;
  1303.       }
  1304.         else
  1305. ***************
  1306. *** 827,833 ****
  1307.            spaces all the way to the screen edge
  1308.            so that the reverse video extends all the way across.  */
  1309.         while (olen < screen_width - 1)
  1310. !         obody[olen++] = ' ';
  1311.       }
  1312.       }
  1313.   
  1314. --- 842,848 ----
  1315.            spaces all the way to the screen edge
  1316.            so that the reverse video extends all the way across.  */
  1317.         while (olen < screen_width - 1)
  1318. !         obody[olen++] = SPACE;
  1319.       }
  1320.       }
  1321.   
  1322. ***************
  1323. *** 842,853 ****
  1324.   
  1325.     /* Pretend trailing spaces are not there at all,
  1326.        unless for one reason or another we must write all spaces.  */
  1327. -   /* We know that the previous character is the `physical' field
  1328. -      and it is zero or one.  */
  1329.     if (! new->highlighted)
  1330.       {
  1331.         if (!must_write_spaces)
  1332. !     while (nbody[nlen - 1] == ' ')
  1333.         nlen--;
  1334.       }
  1335.     else
  1336. --- 857,866 ----
  1337.   
  1338.     /* Pretend trailing spaces are not there at all,
  1339.        unless for one reason or another we must write all spaces.  */
  1340.     if (! new->highlighted)
  1341.       {
  1342.         if (!must_write_spaces)
  1343. !     while ((nbody[nlen - 1] == SPACEGLYF) && (0 != nlen))
  1344.         nlen--;
  1345.       }
  1346.     else
  1347. ***************
  1348. *** 856,862 ****
  1349.        all the way to the screen edge
  1350.        so that the reverse video extends all the way across.  */
  1351.         while (nlen < screen_width - 1)
  1352. !     nbody[nlen++] = ' ';
  1353.       }
  1354.   
  1355.     /* If there's no i/d char, quickly do the best we can without it.  */
  1356. --- 869,875 ----
  1357.        all the way to the screen edge
  1358.        so that the reverse video extends all the way across.  */
  1359.         while (nlen < screen_width - 1)
  1360. !     nbody[nlen++] = SPACE;
  1361.       }
  1362.   
  1363.     /* If there's no i/d char, quickly do the best we can without it.  */
  1364. ***************
  1365. *** 874,880 ****
  1366.                  (i + j >= olen || nbody[i+j] != obody[i+j]));
  1367.              j++);
  1368.             /* Output this run of non-matching chars.  */ 
  1369. !           write_chars (nbody + i, j);
  1370.             i += j - 1;
  1371.             /* Now find the next non-match.  */
  1372.           }
  1373. --- 887,893 ----
  1374.                  (i + j >= olen || nbody[i+j] != obody[i+j]));
  1375.              j++);
  1376.             /* Output this run of non-matching chars.  */ 
  1377. !           write_glyfs (nbody + i, j);
  1378.             i += j - 1;
  1379.             /* Now find the next non-match.  */
  1380.           }
  1381. ***************
  1382. *** 891,901 ****
  1383.     if (!olen)
  1384.       {
  1385.         nsp = (must_write_spaces || new->highlighted)
  1386. !           ? 0 : count_blanks (nbody);
  1387.         if (nlen > nsp)
  1388.       {
  1389.         topos (vpos, nsp);
  1390. !       write_chars (nbody + nsp, nlen - nsp);
  1391.       }
  1392.         return;
  1393.       }
  1394. --- 904,914 ----
  1395.     if (!olen)
  1396.       {
  1397.         nsp = (must_write_spaces || new->highlighted)
  1398. !           ? 0 : count_leading_space_glyfs (nbody);
  1399.         if (nlen > nsp)
  1400.       {
  1401.         topos (vpos, nsp);
  1402. !       write_glyfs (nbody + nsp, nlen - nsp);
  1403.       }
  1404.         return;
  1405.       }
  1406. ***************
  1407. *** 905,913 ****
  1408.     nbody[nlen] = 0;
  1409.   
  1410.     /* Compute number of leading blanks in old and new contents.  */
  1411. !   osp = count_blanks (obody);
  1412.     if (!new->highlighted)
  1413. !     nsp = count_blanks (nbody);
  1414.     else
  1415.       nsp = 0;
  1416.   
  1417. --- 918,926 ----
  1418.     nbody[nlen] = 0;
  1419.   
  1420.     /* Compute number of leading blanks in old and new contents.  */
  1421. !   osp = count_leading_space_glyfs (obody);
  1422.     if (!new->highlighted)
  1423. !     nsp = count_leading_space_glyfs (nbody);
  1424.     else
  1425.       nsp = 0;
  1426.   
  1427. ***************
  1428. *** 919,925 ****
  1429.     if (!must_write_spaces && osp + m1 == olen)
  1430.       {
  1431.         np1 = nbody + nsp;
  1432. !       while (np1[m1] == ' ')
  1433.       m1++;
  1434.       }
  1435.   
  1436. --- 932,938 ----
  1437.     if (!must_write_spaces && osp + m1 == olen)
  1438.       {
  1439.         np1 = nbody + nsp;
  1440. !       while (np1[m1] == SPACEGLYF)
  1441.       m1++;
  1442.       }
  1443.   
  1444. ***************
  1445. *** 950,956 ****
  1446.        Is it worth it?  */
  1447.   
  1448.     tem = (nlen - nsp) - (olen - osp);
  1449. !   if (m2 && tem && m2 <= DCICcost[tem])
  1450.       m2 = 0;
  1451.   
  1452.     /* nsp - osp is the distance to insert or delete.
  1453. --- 963,969 ----
  1454.        Is it worth it?  */
  1455.   
  1456.     tem = (nlen - nsp) - (olen - osp);
  1457. !   if (m2 && tem && m2 <= DCICcost (tem))
  1458.       m2 = 0;
  1459.   
  1460.     /* nsp - osp is the distance to insert or delete.
  1461. ***************
  1462. *** 957,963 ****
  1463.        m1 + m2 is how much we save by doing so.
  1464.        Is it worth it?  */
  1465.   
  1466. !   if (m1 + m2 && nsp != osp && m1 + m2 <= DCICcost[nsp - osp])
  1467.       {
  1468.         m1 = 0;
  1469.         m2 = 0;
  1470. --- 970,976 ----
  1471.        m1 + m2 is how much we save by doing so.
  1472.        Is it worth it?  */
  1473.   
  1474. !   if (m1 + m2 && nsp != osp && m1 + m2 <= DCICcost (nsp - osp))
  1475.       {
  1476.         m1 = 0;
  1477.         m2 = 0;
  1478. ***************
  1479. *** 969,975 ****
  1480.     if (osp > nsp)
  1481.       {
  1482.         topos (vpos, nsp);
  1483. !       delete_chars (osp - nsp);
  1484.       }
  1485.     else if (nsp > osp)
  1486.       {
  1487. --- 982,988 ----
  1488.     if (osp > nsp)
  1489.       {
  1490.         topos (vpos, nsp);
  1491. !       delete_glyfs (osp - nsp);
  1492.       }
  1493.     else if (nsp > osp)
  1494.       {
  1495. ***************
  1496. *** 979,989 ****
  1497.         if (m2 && nlen < olen + nsp - osp)
  1498.       {
  1499.         topos (vpos, nlen - m2 + osp - nsp);
  1500. !       delete_chars (olen + nsp - osp - nlen);
  1501.         olen = nlen - (nsp - osp);
  1502.       }
  1503.         topos (vpos, osp);
  1504. !       insert_chars ((char *)0, nsp - osp);
  1505.       }
  1506.     olen += nsp - osp;
  1507.   
  1508. --- 992,1002 ----
  1509.         if (m2 && nlen < olen + nsp - osp)
  1510.       {
  1511.         topos (vpos, nlen - m2 + osp - nsp);
  1512. !       delete_glyfs (olen + nsp - osp - nlen);
  1513.         olen = nlen - (nsp - osp);
  1514.       }
  1515.         topos (vpos, osp);
  1516. !       insert_spaces (nsp - osp);
  1517.       }
  1518.     olen += nsp - osp;
  1519.   
  1520. ***************
  1521. *** 999,1005 ****
  1522.            going to be "at the margin" after the text is done) */
  1523.         if (nlen == screen_width)
  1524.           olen = 0;
  1525. !       write_chars (nbody + nsp + m1, nlen - tem);
  1526.   #ifdef obsolete
  1527.   /* the following code loses disastrously if tem == nlen.
  1528.      Rather than trying to fix that case, I am trying the simpler
  1529. --- 1012,1018 ----
  1530.            going to be "at the margin" after the text is done) */
  1531.         if (nlen == screen_width)
  1532.           olen = 0;
  1533. !       write_glyfs (nbody + nsp + m1, nlen - tem);
  1534.   #ifdef obsolete
  1535.   /* the following code loses disastrously if tem == nlen.
  1536.      Rather than trying to fix that case, I am trying the simpler
  1537. ***************
  1538. *** 1011,1035 ****
  1539.         if (nlen == screen_width && fast_clear_end_of_line && olen > nlen)
  1540.           {
  1541.             /* m2 must be zero, and tem must equal nsp + m1 */
  1542. !           write_chars (nbody + tem, nlen - tem - 1);
  1543.             clear_end_of_line (olen);
  1544.             olen = 0;        /* Don't let it be cleared again later */
  1545. !           write_chars (nbody + nlen - 1, 1);
  1546.           }
  1547.         else
  1548. !         write_chars (nbody + nsp + m1, nlen - tem);
  1549.   #endif
  1550.       }
  1551.         else if (nlen > olen)
  1552.       {
  1553. !       write_chars (nbody + nsp + m1, olen - tem);
  1554. !       insert_chars (nbody + nsp + m1 + olen - tem, nlen - olen);
  1555.         olen = nlen;
  1556.       }
  1557.         else if (olen > nlen)
  1558.       {
  1559. !       write_chars (nbody + nsp + m1, nlen - tem);
  1560. !       delete_chars (olen - nlen);
  1561.         olen = nlen;
  1562.       }
  1563.       }
  1564. --- 1024,1048 ----
  1565.         if (nlen == screen_width && fast_clear_end_of_line && olen > nlen)
  1566.           {
  1567.             /* m2 must be zero, and tem must equal nsp + m1 */
  1568. !           write_glyfs (nbody + tem, nlen - tem - 1);
  1569.             clear_end_of_line (olen);
  1570.             olen = 0;        /* Don't let it be cleared again later */
  1571. !           write_glyfs (nbody + nlen - 1, 1);
  1572.           }
  1573.         else
  1574. !         write_glyfs (nbody + nsp + m1, nlen - tem);
  1575.   #endif
  1576.       }
  1577.         else if (nlen > olen)
  1578.       {
  1579. !       write_glyfs (nbody + nsp + m1, olen - tem);
  1580. !       insert_glyfs (nbody + nsp + m1 + olen - tem, nlen - olen);
  1581.         olen = nlen;
  1582.       }
  1583.         else if (olen > nlen)
  1584.       {
  1585. !       write_glyfs (nbody + nsp + m1, nlen - tem);
  1586. !       delete_glyfs (olen - nlen);
  1587.         olen = nlen;
  1588.       }
  1589.       }
  1590. ***************
  1591. *** 1043,1063 ****
  1592.       }
  1593.   }
  1594.   
  1595. ! count_blanks (str)
  1596. !      char *str;
  1597.   {
  1598. !   register char *p = str;
  1599. !   while (*str++ == ' ');
  1600. !   return str - p - 1;
  1601. ! }
  1602. ! count_match (str1, str2)
  1603. !      char *str1, *str2;
  1604.   {
  1605. !   register char *p1 = str1;
  1606. !   register char *p2 = str2;
  1607. !   while (*p1++ == *p2++);
  1608. !   return p1 - str1 - 1;
  1609.   }
  1610.   
  1611.   DEFUN ("open-termscript", Fopen_termscript, Sopen_termscript,
  1612. --- 1056,1088 ----
  1613.       }
  1614.   }
  1615.   
  1616. ! int
  1617. ! count_leading_space_glyfs (r)
  1618. ! register glyf_t *r;
  1619.   {
  1620. !    register int i = 0;
  1621. !    while (SPACEGLYF == *r)
  1622. !       {
  1623. !       ++r;
  1624. !       ++i;
  1625. !       }
  1626. !    return (i);
  1627. ! }
  1628. ! int
  1629. ! count_match (r1, r2)
  1630. ! register glyf_t *r1, *r2;
  1631.   {
  1632. !    register int i = 0;
  1633. !    while (*r1 == *r2)
  1634. !       {
  1635. !       ++r1;
  1636. !       ++r2;
  1637. !       ++i;
  1638. !       }
  1639. !    return (i);
  1640.   }
  1641.   
  1642.   DEFUN ("open-termscript", Fopen_termscript, Sopen_termscript,
  1643.