This patch is mainly of interest to those that have
a workstation/terminal that can display Iso Latin characters,
as well as a keyboard that can be used to enter characters in
this extended set (or any iso-latin-mode under epoch). Actually,
it should be useful to type any language with accentuated characters
(French, German, ...)

To apply it, you should be in the main epoch directory.

Some points of interest are:

    -- All characters in ISO 8859-1 are now considered normal
       characters, and are entered and displayed in the usual way.
       (Characters in the range 128..255 can also be displayed
       as \xxx, by setting the variable meta-printable to nil.)
       Commands like up-case-word, forward-word, etc. should
       work as expected.

    -- Key-maps are extended to length 256.

    -- Meta-commands are entered using either the ESC-prefix,
       or the Meta-shift key.

    -- Make sure that you have a font with a full character set
       (ISO 8859-1). If you're running X11R5, it's the case.

    -- DON'T FORGET TO BYTE-COMPILE lisp/isearch.el AGAIN.

    -- As many similar patches were recently posted for emacs-18.58,
       this one *does not handle the Ascii version* of emacs included
       with the epoch-4.0b1 distribution.

I have installed this modified version of Epoch on our
SPARC workstations, and no major problems have surfaced yet.

Some suggestions:

    -- To enter these extended characters, you can either:
       - type them directly if you have a French keyboard or any other
         one adapter to your language
       - bind them to any useless key directly with xmodmap (X11R5 only,
         see /usr/include/X11/keysymdef.h)
       - use any electric mode (I include iso-latin1.el as an example)

    -- LaTeX (3.14) can understand 8bit characters. I include the style
       I use (uuencoded - 'cause 8bit characters are used!).
       Extend it if your not French...

*-----------------------------------------------------------------------------*
| Renaud KERIVEN                 /\    C.E.R.M.I.C.S.                         |
| email: keriven@cadix.enpc.fr  /__\   Ecole Nationale des Ponts et Chaussees |
| tel  : 33 1 43.04.40.98      /\  /\  La Courtine                            |
| fax  : 33 1 43.04.63.64     /__\/__\ F-93167 Noisy-le-Grand Cedex           |
*-----------------------------------------------------------------------------*

----(beginning of the patch)------------------------
*** src.orig/buffer.c	Wed Mar 18 19:09:45 1992
--- src/buffer.c	Wed Mar 18 19:16:04 1992
***************
*** 1116,1121 ****
--- 1116,1122 ----
    XFASTINT (buffer_defaults.tab_width) = 8;
    buffer_defaults.truncate_lines = Qnil;
    buffer_defaults.ctl_arrow = Qt;
+   buffer_defaults.meta_printable = Qt;
  
    XFASTINT (buffer_defaults.fill_column) = 70;
    XFASTINT (buffer_defaults.fill_pixel) = 0; /* Disable */
***************
*** 1160,1165 ****
--- 1161,1167 ----
    XFASTINT (buffer_local_flags.fill_pixel) = 0x4000;
    XFASTINT (buffer_local_flags.line_fill_hook) = 0x8000;
    XFASTINT (buffer_local_flags.undo_buttons) = 0x10000;
+   XFASTINT (buffer_local_flags.meta_printable) = 0x20000;
  
    Vbuffer_alist = Qnil;
    current_buffer = 0;
***************
*** 1230,1235 ****
--- 1232,1241 ----
  	      &buffer_defaults.ctl_arrow,
      "Default ctl-arrow for buffers that do not override it.\n\
  This is the same as (default-value 'ctl-arrow).");
+   DEFVAR_LISP_NOPRO ("default-meta-printable",
+  	      &buffer_defaults.meta_printable,
+     "Default meta-printable for buffers that do not override it.\n\
+ This is the same as (default-value 'meta-printable).");
  
    DEFVAR_LISP_NOPRO ("default-truncate-lines",
  	      &buffer_defaults.truncate_lines,
***************
*** 1337,1345 ****
    DEFVAR_PER_BUFFER ("ctl-arrow", &current_buffer->ctl_arrow,
      "*t means display control chars with uparrow.\n\
  Nil means use backslash and octal digits.\n\
- Otherwise assume that control and meta characters are printable.\n\
  Automatically becomes local when set in any fashion.");
  
    DEFVAR_PER_BUFFER ("truncate-lines", &current_buffer->truncate_lines,
      "*Non-nil means do not display continuation lines;\n\
  give each line of text one screen line.\n\
--- 1343,1356 ----
    DEFVAR_PER_BUFFER ("ctl-arrow", &current_buffer->ctl_arrow,
      "*t means display control chars with uparrow.\n\
  Nil means use backslash and octal digits.\n\
  Automatically becomes local when set in any fashion.");
  
+   DEFVAR_PER_BUFFER ("meta-printable", &current_buffer->meta_printable,
+     "*Non-nil means meta characters, that is characters in the range \n\
+ 0240..0377, are printable.\n\
+ Nil means display meta chars with backslash and octal digits.\n\
+ Automatically becomes local when set in any fashion.");
+   
    DEFVAR_PER_BUFFER ("truncate-lines", &current_buffer->truncate_lines,
      "*Non-nil means do not display continuation lines;\n\
  give each line of text one screen line.\n\
*** src.orig/buffer.h	Wed Mar 18 19:09:45 1992
--- src/buffer.h	Wed Mar 18 19:18:13 1992
***************
*** 216,221 ****
--- 216,223 ----
      Lisp_Object truncate_lines;
      /* Non-nil means display ctl chars with uparrow */
      Lisp_Object ctl_arrow;
+     /* Non-nil means meta chars are printable. */
+     Lisp_Object meta_printable;
      /* Non-nil means do selective display;
         See doc string in syms_of_buffer (buffer.c) for details.  */
      Lisp_Object selective_display;
***************
*** 281,285 ****
--- 283,290 ----
  #define BufferSafeCeiling(n) (((n) < GPT && GPT < ZV ? GPT : ZV) - 1)
  
  #define BufferSafeFloor(n) (BEGV <= GPT && GPT <= (n) ? GPT : BEGV)
+ 
+ #define is_control_char(c)   (((c) >= 0 && (c) < 040) || (c) == 0177)
+ #define is_meta_char(c) ((c) >= 0240 && (c) <= 0377)
  
  extern void reset_buffer ();
*** src.orig/cmds.c	Wed Mar 18 19:09:45 1992
--- src/cmds.c	Thu Mar 19 09:30:11 1992
***************
*** 370,376 ****
    ndefkey (Vglobal_map, Ctl('I'), "self-insert-command");
    for (n = 040; n < 0177; n++)
      ndefkey (Vglobal_map, n, "self-insert-command");
! 
    ndefkey (Vglobal_map, Ctl ('A'), "beginning-of-line");
    ndefkey (Vglobal_map, Ctl ('B'), "backward-char");
    ndefkey (Vglobal_map, Ctl ('D'), "delete-char");
--- 370,378 ----
    ndefkey (Vglobal_map, Ctl('I'), "self-insert-command");
    for (n = 040; n < 0177; n++)
      ndefkey (Vglobal_map, n, "self-insert-command");
!   for (n = 0240; n <= 0377; n++)
!  	ndefkey (Vglobal_map, n, "self-insert-command");
!   
    ndefkey (Vglobal_map, Ctl ('A'), "beginning-of-line");
    ndefkey (Vglobal_map, Ctl ('B'), "backward-char");
    ndefkey (Vglobal_map, Ctl ('D'), "delete-char");
*** src.orig/indent.c	Wed Mar 18 19:09:47 1992
--- src/indent.c	Thu Mar 19 09:51:36 1992
***************
*** 114,120 ****
    int ctl_arrow = (!NULL (current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow,Qt));
    int old_pt = point;
! 
    if (arg) SET_PT(arg);
  
    if (point == last_known_column_point
--- 114,121 ----
    int ctl_arrow = (!NULL (current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow,Qt));
    int old_pt = point;
!   int meta_printable = !NULL (current_buffer->meta_printable);
!   
    if (arg) SET_PT(arg);
  
    if (point == last_known_column_point
***************
*** 171,183 ****
  	  post_tab += col;
  	  col = 0;
  	  tab_seen = 1;
! 	}
!       else
! 	col += (ctl_arrow == 1 && c >= 0177) ? 1 :
! 	  (ctl_arrow && c < 0200) ? 2 : 4;
! 
!     }
! 
    if (tab_seen)
      {
        col = ((col + tab_width) / tab_width) * tab_width;
--- 172,185 ----
  	  post_tab += col;
  	  col = 0;
  	  tab_seen = 1;
!   } else if (is_control_char(c))
!  	  col += ctl_arrow ? 2 : 4;
!   else if (is_meta_char(c))
!     col += meta_printable ? 1 : 4;
!   else
!  	col += 4;
!   }
!   
    if (tab_seen)
      {
        col = ((col + tab_width) / tab_width) * tab_width;
***************
*** 513,518 ****
--- 515,521 ----
    register int tab_width = XINT(current_buffer->tab_width);
    register int ctl_arrow = (!NULL (current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow, Qt));
+   register int meta_printable = !NULL (current_buffer->meta_printable);
    struct X_font *font;
    struct buffer *b = current_buffer;
  
***************
*** 551,556 ****
--- 554,560 ----
  	}
        else if (ctl_arrow == 1 && a >= 040)
  	continue;
+ 	  /*
        else if (ctl_arrow && (a < 040 || a == 0177))
  	{
  	  col++;
***************
*** 563,568 ****
--- 567,587 ----
  	  c[0] = '0';
  	  pix += text_width(font,c,1);
  	}
+ 	  */
+ 	  else if (is_control_char(a))
+ 	{
+  	  col += ctl_arrow ? 1 : 3;
+  	  c[0] = '0';
+  	  pix += text_width(font,c,1);
+     } else  if (is_meta_char(a)) {
+ 	  col += meta_printable ? 0 : 3;
+ 	  c[0] = '0';
+ 	  pix += text_width(font,c,1);
+     } else if (a < 040 || a >= 0177) {
+ 	  col += 3;
+ 	  c[0] = '0';
+ 	  pix += text_width(font,c,1);
+     }
      }      
  
    SET_PT(pos);
***************
*** 604,610 ****
    register int tab_width = XINT (current_buffer->tab_width);
    register int ctl_arrow = (!NULL (current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow, Qt));
! 
    if (tab_width <= 0 || tab_width > 20) tab_width = 8;
  
    if (col > goal)
--- 623,630 ----
    register int tab_width = XINT (current_buffer->tab_width);
    register int ctl_arrow = (!NULL (current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow, Qt));
!   register int meta_printable = !NULL (current_buffer->meta_printable);
!   
    if (tab_width <= 0 || tab_width > 20) tab_width = 8;
  
    if (col > goal)
***************
*** 631,645 ****
  	}
        else if (ctl_arrow == 1 && c >= 040)
  	continue;
!       else if (ctl_arrow && (c < 040 || c == 0177))
! 	{
! 	  col++;
! 	}
!       else if (c < 040 || c >= 0177)
! 	{
! 	  col += 3;
! 	}
!     }
  
    SET_PT (pos);
  
--- 651,664 ----
  	}
        else if (ctl_arrow == 1 && c >= 040)
  	continue;
! 	  else if (is_control_char(c)) {
!  		  col += ctl_arrow ? 1 : 3;
!       } else  if (is_meta_char(c)) {
!  		  col += meta_printable ? 0 : 3;
!  	  } else if (c < 040 || c >= 0177) {
!  		  col += 3;
!  	  }
!   }
  
    SET_PT (pos);
  
***************
*** 714,719 ****
--- 733,739 ----
    int button_end, button_start;
    int truncate = hscroll || (truncate_partial_width_windows &&
  			     XFASTINT(w->pixwidth) < XWSCREEN(XROOT(w->root)->win)->pixw);
+   int meta_printable = !NULL (current_buffer->meta_printable);
    int selective = XTYPE (current_buffer->selective_display) == Lisp_Int
      ? XINT (current_buffer->selective_display)
        : !NULL (current_buffer->selective_display) ? -1 : 0;
***************
*** 853,861 ****
        else
  	{
  	  int i;
! 	  int inc = (ctl_arrow == 1 && c >= 040) ? 1 :
! 	    (ctl_arrow && c < 0200) ? 2 : 4;
! 
  	  a[0] = '0';
  	  for (i = 0; i < inc; i++)
  	    CHECK_NEXT(a);
--- 873,887 ----
        else
  	{
  	  int i;
!  	  int inc;
!  
!       if (is_control_char(c))
!   	    inc = ctl_arrow ? 2 : 4;
!       else if (is_meta_char(c))
!   	    inc = meta_printable ? 1 : 4;
!       else
!   	    inc = 4;
!   
  	  a[0] = '0';
  	  for (i = 0; i < inc; i++)
  	    CHECK_NEXT(a);
*** src.orig/keyboard.c	Wed Mar 18 19:09:47 1992
--- src/keyboard.c	Thu Mar 19 09:52:46 1992
***************
*** 1542,1553 ****
  
        if (c < 0)
  	return 0;
!       if (c >= 0200)
  	{
  	  nextc = c & 0177;
  	  c = meta_prefix_char;
  	}
! 
        keybuf[i] = c;
  
        global = !NIL (nextglobal)
--- 1542,1553 ----
  
        if (c < 0)
  	return 0;
! /*      if (c >= 0200)
  	{
  	  nextc = c & 0177;
  	  c = meta_prefix_char;
  	}
! */
        keybuf[i] = c;
  
        global = !NIL (nextglobal)
*** src.orig/keymap.c	Wed Mar 18 19:09:47 1992
--- src/keymap.c	Thu Mar 19 16:45:20 1992
***************
*** 64,83 ****
  
  Lisp_Object Qkeymapp, Qkeymap;
  
- /* A char over 0200 in a key sequence
-    is equivalent to prefixing with this character.  */
- 
- extern int meta_prefix_char;
- 
  static void insert_first_line();
  
  DEFUN ("make-keymap", Fmake_keymap, Smake_keymap, 0, 0, 0,
!   "Construct and return a new keymap, a vector of length 128.\n\
  All entries in it are nil, meaning \"command undefined\".")
    ()
  {
    register Lisp_Object val;
!   XFASTINT (val) = 0200;
    return Fmake_vector (val, Qnil);
  }
  
--- 64,78 ----
  
  Lisp_Object Qkeymapp, Qkeymap;
  
  static void insert_first_line();
  
  DEFUN ("make-keymap", Fmake_keymap, Smake_keymap, 0, 0, 0,
!   "Construct and return a new keymap, a vector of length 256.\n\
  All entries in it are nil, meaning \"command undefined\".")
    ()
  {
    register Lisp_Object val;
!   XFASTINT (val) = 0400;
    return Fmake_vector (val, Qnil);
  }
  
***************
*** 121,127 ****
  
  DEFUN ("keymapp", Fkeymapp, Skeymapp, 1, 1, 0,
    "Return t if ARG is a keymap.\n\
! A keymap is a vector of length 128, or a list (keymap . ALIST),\n\
  where alist elements look like (CHAR . DEFN).\n\
  A symbol whose function definition is a keymap is itself a keymap.")
    (object)
--- 116,122 ----
  
  DEFUN ("keymapp", Fkeymapp, Skeymapp, 1, 1, 0,
    "Return t if ARG is a keymap.\n\
! A keymap is a vector of length 256, or a list (keymap . ALIST),\n\
  where alist elements look like (CHAR . DEFN).\n\
  A symbol whose function definition is a keymap is itself a keymap.")
    (object)
***************
*** 137,143 ****
        QUIT;
      }
  
!   if ((XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == 0200)
        || (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap)))
      return Qt;
    return Qnil;
--- 132,138 ----
        QUIT;
      }
  
!   if ((XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == 0400)
        || (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap)))
      return Qt;
    return Qnil;
***************
*** 158,164 ****
  	  tem = XSYMBOL (tem)->function;
  	  QUIT;
  	}
!       if ((XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == 0200)
  	  || (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap)))
  	return tem;
        if (error)
--- 153,159 ----
  	  tem = XSYMBOL (tem)->function;
  	  QUIT;
  	}
!       if ((XTYPE (tem) == Lisp_Vector && XVECTOR (tem)->size == 0400)
  	  || (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap)))
  	return tem;
        if (error)
***************
*** 200,207 ****
       register int idx;
  {
    register Lisp_Object val;
!   if (idx < 0 || idx >= 0200)
!     error ("Command key out of range 0-127");
  
    /* Get definition for character `idx' proper.  */
    if (CONSP (map))
--- 195,202 ----
       register int idx;
  {
    register Lisp_Object val;
!   if (idx < 0 || idx >= 0400)
!     error ("Command key out of range 0-255");
  
    /* Get definition for character `idx' proper.  */
    if (CONSP (map))
***************
*** 220,227 ****
  {
    register Lisp_Object tem;
  
!   if (idx < 0 || idx >= 0200)
!     error ("Command key out of range 0-127");
  
    if (CONSP (keymap))
      {
--- 215,222 ----
  {
    register Lisp_Object tem;
  
!   if (idx < 0 || idx >= 0400)
!     error ("Command key out of range 0-255");
  
    if (CONSP (keymap))
      {
***************
*** 298,304 ****
    register int c;
    register Lisp_Object tem;
    register Lisp_Object cmd;
-   int metized = 0;
  
    keymap = get_keymap (keymap);
  
--- 293,298 ----
***************
*** 310,326 ****
    while (1)
      {
        c = XSTRING (key)->data[idx];
!       if (c >= 0200 && !metized)
! 	{
! 	  c = meta_prefix_char;
! 	  metized = 1;
! 	}
!       else
! 	{
! 	  c &= 0177;
! 	  metized = 0;
! 	  idx++;
! 	}
  
        if (idx == XSTRING (key)->size)
  	return store_in_keymap (keymap, c, def);
--- 304,310 ----
    while (1)
      {
        c = XSTRING (key)->data[idx];
! 	idx++;
  
        if (idx == XSTRING (key)->size)
  	return store_in_keymap (keymap, c, def);
***************
*** 358,364 ****
    register Lisp_Object tem;
    register Lisp_Object cmd;
    register int c;
-   int metized = 0;
  
    keymap = get_keymap (keymap);
  
--- 342,347 ----
***************
*** 370,387 ****
    while (1)
      {
        c = XSTRING (key)->data[idx];
!       if (c >= 0200 && !metized)
! 	{
! 	  c = meta_prefix_char;
! 	  metized = 1;
! 	}
!       else
! 	{
! 	  c &= 0177;
! 	  metized = 0;
! 	  idx++;
! 	}
! 
        cmd = get_keyelt (access_keymap (keymap, c));
        if (idx == XSTRING (key)->size)
  	return cmd;
--- 353,359 ----
    while (1)
      {
        c = XSTRING (key)->data[idx];
! 	idx++;
        cmd = get_keyelt (access_keymap (keymap, c));
        if (idx == XSTRING (key)->size)
  	return cmd;
***************
*** 586,592 ****
      {
        thisseq = Fcar (Fcar (tail));
        thismap = Fcdr (Fcar (tail));
!       for (i = 0; i < 0200; i++)
  	{
  	  cmd = get_keyelt (access_keymap (thismap, i));
  	  if (NULL (cmd)) continue;
--- 558,564 ----
      {
        thisseq = Fcar (Fcar (tail));
        thismap = Fcdr (Fcar (tail));
!       for (i = 0; i < 0400; i++)
  	{
  	  cmd = get_keyelt (access_keymap (thismap, i));
  	  if (NULL (cmd)) continue;
***************
*** 626,637 ****
       register unsigned int c;
       register char *p;
  {
-   if (c >= 0200)
-     {
-       *p++ = 'M';
-       *p++ = '-';
-       c -= 0200;
-     }
    if (c < 040)
      {
        if (c == 033)
--- 598,603 ----
***************
*** 707,718 ****
       register unsigned int c;
       register char *p;
  {
-   if (c >= 0200)
-     {
-       *p++ = 'M';
-       *p++ = '-';
-       c -= 0200;
-     }
    if (c < 040)
      {
        *p++ = '^';
--- 673,678 ----
***************
*** 779,785 ****
        /* If the MAP is a vector, I increments and eventually reaches 0200.
  	 Otherwise I remains 0; MAP is cdr'd and eventually becomes nil.  */
  
!       while (!NULL (map) && i < 0200)
  	{
  	  register Lisp_Object elt, dummy;
  
--- 739,745 ----
        /* If the MAP is a vector, I increments and eventually reaches 0200.
  	 Otherwise I remains 0; MAP is cdr'd and eventually becomes nil.  */
  
!       while (!NULL (map) && i < 0400)
  	{
  	  register Lisp_Object elt, dummy;
  
*** src.orig/regex.c	Wed Mar 18 19:09:49 1992
--- src/regex.c	Thu Mar 19 10:02:44 1992
***************
*** 1617,1627 ****
      0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
      0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
      0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
!     0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
!     0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
!     0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
!     0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
!     0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
    };
  
  main (argc, argv)
--- 1617,1627 ----
      0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
      0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
      0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
!     0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
!     0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
!     0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
!     0330, 0331, 0332, 0333, 0334, 0335, 0336, 0367,
!     0340, 0341, 0342, 0343, 0344, 0345, 0346, 0377
    };
  
  main (argc, argv)
*** src.orig/search.c	Wed Mar 18 19:09:49 1992
--- src/search.c	Thu Mar 19 10:23:21 1992
***************
*** 1283,1297 ****
  
    for (i = 0; i < 0400; i++)
      {
!       downcase_table[i] = (i >= 'A' && i <= 'Z') ? i + 040 : i;
  /* We do this instead of using compute_trt_inverse to save space. */
!  /* Does it? */
!       downcase_table[0400+i]
! 	= ((i >= 'A' && i <= 'Z')
! 	   ? i + ('a' - 'A')
! 	   : ((i >= 'a' && i <= 'z')
! 	      ? i + ('A' - 'a')
! 	      : i));
      }
  /* Use this instead when there come to be multiple translation tables. 
    compute_trt_inverse (downcase_table);    */
--- 1283,1316 ----
  
    for (i = 0; i < 0400; i++)
      {
!         /*
!          * Table updated to handle extended character set.
!          */
!         if (i >= 'A' && i <= 'Z')
!   	downcase_table[i] = i + 'a' - 'A';
!         else if (i >= 0300 && i <= 0326)
!   	downcase_table[i] = i + 040;
!         else if (i >= 0330 && i <= 0336)
!   	downcase_table[i] = i + 040;
!         else
!   	downcase_table[i] = i;
  /* We do this instead of using compute_trt_inverse to save space. */
! /* Does it? */
!   
!  	   if (i >= 'A' && i <= 'Z')
!  	downcase_table[0400+i] = i + 'a' - 'A';
!         else if (i >= 0300 && i <= 0326)
!   	downcase_table[0400+i] = i + 040;
!         else if (i >= 0330 && i <= 0336)
!   	downcase_table[0400+i] = i + 040;
!         else if (i >= 'a' && i <= 'z')
!   	downcase_table[0400+i] = i + 'A' - 'a';
!        else if (i >= 0340 && i <= 0366)
!   	downcase_table[0400+i] = i - 040;
!         else if (i >= 0370 && i <= 0376)
!   	downcase_table[0400+i] = i - 040;
!         else
!   	downcase_table[0400+i] = i;
      }
  /* Use this instead when there come to be multiple translation tables. 
    compute_trt_inverse (downcase_table);    */
*** src.orig/syntax.c	Wed Mar 18 19:09:49 1992
--- src/syntax.c	Thu Mar 19 11:09:34 1992
***************
*** 1106,1111 ****
--- 1106,1139 ----
  
    for (i = 0; i < 12; i++)
      XFASTINT (v->contents[".,;:?!#@~^'`"[i]]) = (int) Spunct;
+  
+     /*
+      * Syntax table entries for extended character set:
+      */
+   
+     for (i = 0300; i <= 0326; i++)
+       XFASTINT (v->contents[i]) = (int) Sword;
+     for (i = 0330; i <= 0337; i++)
+       XFASTINT (v->contents[i]) = (int) Sword;
+     for (i = 0340; i <= 0366; i++)
+       XFASTINT (v->contents[i]) = (int) Sword;
+     for (i = 0370; i <= 0377; i++)
+       XFASTINT (v->contents[i]) = (int) Sword;
+   
+     XFASTINT (v->contents[0240]) = (int) Swhitespace;
+     
+     for (i = 0242; i <= 0245; i++)
+       XFASTINT (v->contents[i]) = (int) Sword;
+   
+     for (i = 0246; i <= 0276; i++)
+       XFASTINT (v->contents[i]) = (int) Ssymbol;
+   
+     XFASTINT (v->contents[0327]) = (int) Ssymbol;
+     XFASTINT (v->contents[0367]) = (int) Ssymbol;
+   
+     XFASTINT (v->contents[0241]) = (int) Spunct;
+     XFASTINT (v->contents[0277]) = (int) Spunct;
+ 
  }
  
  syms_of_syntax ()
*** src.orig/x11term.c	Fri Mar 27 09:48:26 1992
--- src/x11term.c	Fri Mar 27 09:57:18 1992
***************
*** 155,160 ****
--- 155,162 ----
  extern char **xargv;
  
  int XXpid;
+   
+ static XComposeStatus status;
  
  static int InUpdate;		/* many of functions here may be invoked
  				 * even if no update in progress; when
***************
*** 264,269 ****
--- 266,274 ----
  	fprintf (stderr, "XTset_terminal_modes\n");
  #endif
    InUpdate = 0;
+   status.compose_ptr = 0;
+   status.chars_matched = 0;
+    
    if (!initialized)
      {
        xs->cursor_exists = 0;
***************
*** 1132,1139 ****
    char mapping_buf[20];
    BLOCK_INPUT_DECLARE ();
    XEvent event;
-   /* Must be static since data is saved between calls.  */
-   static XComposeStatus status;
    KeySym keysym;
    SIGMASKTYPE oldmask;
    struct Root_Block *rb,*x_find_screen();
--- 1137,1142 ----
***************
*** 1141,1146 ****
--- 1144,1150 ----
    struct W_Screen *ws;
    struct X_font *font;
    Display *xdisp = XXSCREEN(root->x11)->display;
+   extern int meta_prefix_char;
  
    extern Atom selection_selection;
    extern Window selection_screen;
***************
*** 1377,1383 ****
  	case KeyPress:
  	  nbytes = XLookupString (&event.xkey,
  				  mapping_buf, MAPPINGBUFLEN, &keysym,
! 				  0);
  	  /* Someday this will be unnecessary as we will
  	   * be able to use XRebindKeysym so XLookupString
  	   * will have already given us the string we want.
--- 1381,1387 ----
  	case KeyPress:
  	  nbytes = XLookupString (&event.xkey,
  				  mapping_buf, MAPPINGBUFLEN, &keysym,
! 				  &status);
  	  /* Someday this will be unnecessary as we will
  	   * be able to use XRebindKeysym so XLookupString
  	   * will have already given us the string we want.
***************
*** 1389,1395 ****
  	      extern char *stringFuncVal();
  
  	      if (!EQ(Qnil,Vepoch_function_key_mapping) &&
! 		  (IsFunctionKey(keysym) || IsMiscFunctionKey(keysym)))
  		{
  		  strcpy(mapping_buf,"\033[");
  		  strcat(mapping_buf,stringFuncVal(keysym));
--- 1393,1401 ----
  	      extern char *stringFuncVal();
  
  	      if (!EQ(Qnil,Vepoch_function_key_mapping) &&
! 			  (IsFunctionKey(keysym)
!             || (IsMiscFunctionKey(keysym) && (keysym != XK_Mode_switch))))
!   		
  		{
  		  strcpy(mapping_buf,"\033[");
  		  strcat(mapping_buf,stringFuncVal(keysym));
***************
*** 1417,1424 ****
  #endif				/* not AIX */
  	  if (nbytes)
  	    {
! 	      if ((nbytes == 1) && (event.xkey.state & Mod1Mask))
! 		*mapping_buf |= METABIT;
  	      if (numchars > nbytes)
  		{
  		  int i;
--- 1423,1445 ----
  #endif				/* not AIX */
  	  if (nbytes)
  	    {
!               if ((nbytes == 1) && (event.xkey.state & Mod1Mask)) {
!         /* Character typed with META-shift key held down is split
!            into META-prefix + ASCII-character. */
!         mapping_buf[1] = mapping_buf[0] & 0x7F;
!         mapping_buf[0] = meta_prefix_char;
!         nbytes = 2;
!       }
!       else if ((nbytes == 1) && (event.xkey.state & Mod3Mask)) {
!         KeySym ks;
! #define KeysymToChar(k) (k & 0xFF)
! 
!         if ((ks = XLookupKeysym(&event.xkey,
!                                 (event.xkey.state & ShiftMask) ? 3 : 2))
!             != NoSymbol) {
!           *mapping_buf = KeysymToChar(ks);
!         }
!       }
  	      if (numchars > nbytes)
  		{
  		  int i;
*** src.orig/x11term.h	Wed Mar 18 19:09:51 1992
--- src/x11term.h	Thu Mar 19 10:46:43 1992
***************
*** 10,15 ****
--- 10,16 ----
  #include <X11/keysym.h>
  #include <X11/cursorfont.h>
  #include <X11/Xutil.h>
+ #include <X11/X10.h>
  #include "emacssignal.h"
  
  #define XMOUSEBUFSIZE 64
*** src.orig/xdispepoch.c	Wed Mar 18 19:09:52 1992
--- src/xdispepoch.c	Thu Mar 19 10:57:31 1992
***************
*** 2423,2428 ****
--- 2423,2429 ----
    int tab_width = XINT(current_buffer->tab_width);
    int ctl_arrow = (!NULL(current_buffer->ctl_arrow))
      + (EQ (current_buffer->ctl_arrow, Qt));
+   int meta_printable = !NULL (current_buffer->meta_printable);
    struct position val;
    struct buffer *b = current_buffer;
    int pixright = w->pixleft + w->pixwidth;
***************
*** 2626,2632 ****
  	}
        c = *p++;
        multi = 0;
!       if (c >= 040 && c < 0177)
  	{
  	  if (numchars < 0)
  	    numchars++;
--- 2627,2634 ----
  	}
        c = *p++;
        multi = 0;
!       if ((c >= 040 && c < 0177)
!              || (meta_printable && is_meta_char(c)))
  	{
  	  if (numchars < 0)
  	    numchars++;
***************
*** 2813,2819 ****
  	      lwidth += prev->width;
  	    }
  	}
!       else if (c < 0200 && ctl_arrow)
  	{
  	  multi = 1;
  	  if (numchars < 0)
--- 2815,2821 ----
  	      lwidth += prev->width;
  	    }
  	}
!       else if (is_control_char(c) && ctl_arrow)
  	{
  	  multi = 1;
  	  if (numchars < 0)
***************
*** 3275,3281 ****
        c = *string++;
        if (!c) break;
  
!       if (c >= 040 && c < 0177)
  	{
  	  if ((cb->ch != c) || (cb->style != style) || replot_lines)
  	    {
--- 3277,3284 ----
        c = *string++;
        if (!c) break;
  
!       if ((c >= 040 && c < 0177)
! 		  		  || (buffer_defaults.meta_printable && is_meta_char(c))) 
  	{
  	  if ((cb->ch != c) || (cb->style != style) || replot_lines)
  	    {
***************
*** 3324,3330 ****
  	  numchars++;
  	  lwidth += prev->width;
  	}
!       else if (c < 0200 && buffer_defaults.ctl_arrow)
  	{
  	  c1 = '^';	      
  	  if ((cb->ch != c1) || (cb->style != style) || replot_lines)
--- 3327,3333 ----
  	  numchars++;
  	  lwidth += prev->width;
  	}
!       else if (is_control_char(c) && buffer_defaults.ctl_arrow)
  	{
  	  c1 = '^';	      
  	  if ((cb->ch != c1) || (cb->style != style) || replot_lines)
*** lisp.orig/isearch.el	Thu Mar 19 10:58:22 1992
--- lisp/isearch.el	Thu Mar 19 11:01:14 1992
***************
*** 107,119 ****
  			 ?\C-g
  		       (read-char))))
  	   (setq quit-flag nil adjusted nil)
! 	   ;; Meta character means exit search.
! 	   (cond ((and (>= char 128)
! 		       search-exit-option)
! 		  (setq unread-command-char char)
! 		  (throw 'search-done t))
! 		 ((eq char search-exit-char)
! 		  ;; Esc means exit search normally.
  		  ;; Except, if first thing typed, it means do nonincremental
  		  (if (= 0 (length search-string))
  		      (nonincremental-search forward regexp))
--- 107,120 ----
  			 ?\C-g
  		       (read-char))))
  	   (setq quit-flag nil adjusted nil)
!   	   ;; Meta character no longer means exit search.
!   	   (cond
!  		;;((and (>= char 128)
!  		;;     search-exit-option)
!  		;;(setq unread-command-char char)
!  		;;(throw 'search-done t))
!    		 ((eq char search-exit-char)
! 	   ;; Esc means exit search normally.
  		  ;; Except, if first thing typed, it means do nonincremental
  		  (if (= 0 (length search-string))
  		      (nonincremental-search forward regexp))
----(end of the patch)------------------------------

----(beginning of latin1.sty)-----------------------

begin 644 latin1.sty
M7&-A=&-O9&4@8%S'(#T@7&%C=&EV92!<9&5F(,=[7&,@0WT*7&-A=&-O9&4@
M8%SG(#T@7&%C=&EV92!<9&5F(.=[7&,@8WT*"EQC871C;V1E(&!<P2 ](%QA
M8W1I=F4@7&1E9B#!>UPG07T*7&-A=&-O9&4@8%SA(#T@7&%C=&EV92!<9&5F
M(.%[7"=A?0I<8V%T8V]D92!@7,D@/2!<86-T:79E(%QD968@R7M<)T5]"EQC
M871C;V1E(&!<Z2 ](%QA8W1I=F4@7&1E9B#I>UPG97T*7&-A=&-O9&4@8%S-
M(#T@7&%C=&EV92!<9&5F(,U[7"=)?0I<8V%T8V]D92!@7.T@/2!<86-T:79E
M(%QD968@[7M<)UQI?0I<8V%T8V]D92!@7-,@/2!<86-T:79E(%QD968@TWM<
M)T]]"EQC871C;V1E(&!<\R ](%QA8W1I=F4@7&1E9B#S>UPG;WT*7&-A=&-O
M9&4@8%S:(#T@7&%C=&EV92!<9&5F(-I[7"=5?0I<8V%T8V]D92!@7/H@/2!<
M86-T:79E(%QD968@^GM<)W5]"@I<8V%T8V]D92!@7, @/2!<86-T:79E(%QD
M968@P'M<8$%]"EQC871C;V1E(&!<X" ](%QA8W1I=F4@7&1E9B#@>UQ@87T*
M7&-A=&-O9&4@8%S((#T@7&%C=&EV92!<9&5F(,A[7&!%?0I<8V%T8V]D92!@
M7.@@/2!<86-T:79E(%QD968@Z'M<8&5]"EQC871C;V1E(&!<S" ](%QA8W1I
M=F4@7&1E9B#,>UQ@27T*7&-A=&-O9&4@8%SL(#T@7&%C=&EV92!<9&5F(.Q[
M7&!<:7T*7&-A=&-O9&4@8%S2(#T@7&%C=&EV92!<9&5F(-)[7&!/?0I<8V%T
M8V]D92!@7/(@/2!<86-T:79E(%QD968@\GM<8&]]"EQC871C;V1E(&!<V2 ]
M(%QA8W1I=F4@7&1E9B#9>UQ@57T*7&-A=&-O9&4@8%SY(#T@7&%C=&EV92!<
M9&5F(/E[7&!U?0H*7&-A=&-O9&4@8%S$(#T@7&%C=&EV92!<9&5F(,1[7")!
M?0I<8V%T8V]D92!@7.0@/2!<86-T:79E(%QD968@Y'M<(F%]"EQC871C;V1E
M(&!<RR ](%QA8W1I=F4@7&1E9B#+>UPB17T*7&-A=&-O9&4@8%SK(#T@7&%C
M=&EV92!<9&5F(.M[7")E?0I<8V%T8V]D92!@7,\@/2!<86-T:79E(%QD968@
MSWM<(DE]"EQC871C;V1E(&!<[R ](%QA8W1I=F4@7&1E9B#O>UPB7&E]"EQC
M871C;V1E(&!<UB ](%QA8W1I=F4@7&1E9B#6>UPB3WT*7&-A=&-O9&4@8%SV
M(#T@7&%C=&EV92!<9&5F(/9[7")O?0I<8V%T8V]D92!@7-P@/2!<86-T:79E
M(%QD968@W'M<(E5]"EQC871C;V1E(&!<_" ](%QA8W1I=F4@7&1E9B#\>UPB
M=7T*"EQC871C;V1E(&!<PB ](%QA8W1I=F4@7&1E9B#">UQ>07T*7&-A=&-O
M9&4@8%SB(#T@7&%C=&EV92!<9&5F(.)[7%YA?0I<8V%T8V]D92!@7,H@/2!<
M86-T:79E(%QD968@RGM<7D5]"EQC871C;V1E(&!<ZB ](%QA8W1I=F4@7&1E
M9B#J>UQ>97T*7&-A=&-O9&4@8%S.(#T@7&%C=&EV92!<9&5F(,Y[7%Y)?0I<
M8V%T8V]D92!@7.X@/2!<86-T:79E(%QD968@[GM<7EQI?0I<8V%T8V]D92!@
M7-0@/2!<86-T:79E(%QD968@U'M<7D]]"EQC871C;V1E(&!<]" ](%QA8W1I
M=F4@7&1E9B#T>UQ>;WT*7&-A=&-O9&4@8%S;(#T@7&%C=&EV92!<9&5F(-M[
M7%Y5?0I<8V%T8V]D92!@7/L@/2!<86-T:79E(%QD968@^WM<7G5]"@I<8V%T
M8V]D92!@7/$@/2!<86-T:79E(%QD968@\7M<?FY]"EQC871C;V1E(&!<T2 ]
7(%QA8W1I=F4@7&1E9B#1>UQ^3GT*"@H@
 
end

----(end of latin1.sty)-----------------------------

----(beginning of iso-latin-1.el)-------------------

;;; iso-latin-1.el
;;; An electric mode to type in 8 bits ISO latin 1 characters
;;; Copyright (C) 1990 Matthieu Herrb

(provide 'iso-latin-1)

;;; this structure defines all translations that are made.
(defconst iso-chars-alist
  '(("\"" . ((?a . ?\344)(?e . ?\353)(?i . ?\357)(?o . ?\366)(?u . ?\374)
	     (?A . ?\304)(?E . ?\313)(?I . ?\317)(?O . ?\326)(?U . ?\334)))
    ("^" . ((?a . ?\342)(?e . ?\352)(?i . ?\356)(?o . ?\364)(?u . ?\373)
	    (?A . ?\302)(?E . ?\312)(?I . ?\316)(?O . ?\324)(?U . ?\333)))
    ("`" . ((?a . ?\340)(?e . ?\350)(?i . ?\354)(?o . ?\362)(?u . ?\371)
	    (?A . ?\300)(?E . ?\310)(?I . ?\314)(?O . ?\322)(?U . ?\331)))
    ("'" . ((?a . ?\341)(?e . ?\351)(?i . ?\355)(?o . ?\363); (?u . ?\372)
	    (?y . ?\375)
	    (?A . ?\301)(?E . ?\311)(?I . ?\315)(?O . ?\323); (?U . ?\332)
	    (?Y . ?\335)))
    ("," . ((?c . ?\347)(?C . ?\307)))
    ("~" . ((?n . ?\361)(?N . ?\321)))
    ("<" . ((?< . ?\253)))
    (">" . ((?> . ?\273)))
    
    ))

;;; structure to hold old definitions of characters
(defvar iso-defs-alist nil)


;;; two utility functions
(defun cadr (l) (car (cdr l)))

(defun iso-replace-char (char count)
  (delete-backward-char 1)
  (insert-char char count))

;;; this function is bound to every modifier key defined in iso-chars-alist
(defun electric-latin-1-modifier (arg)
  "*transform preceeding character to ISO LATIN 1 if possible"
  (interactive "P")
    (let* ((typed-char (substring (this-command-keys) -1 nil))
	   (char-alist (assoc typed-char iso-chars-alist))
	   (old-def  (cadr (assoc typed-char iso-defs-alist))))
      (if char-alist
	  (let ((count (prefix-numeric-value arg))
		(match (assoc (preceding-char) (cdr char-alist))))
	    (if match
		(iso-replace-char (cdr match) count)
	      (call-interactively old-def nil)))
	(error "char %s not in iso-char-alist" (this-command-keys)))))


;;; initialize all bindings
(defun set-iso-defs ()
  ;; turn on 8 bit display
  (setq ctl-arrow 1)
  (if (eq (key-binding "'") 'electric-latin-1-modifier)
      (message "iso-latin-1 mode already active")
    ;; define new local keymap if necessary
    (setq iso-latin-1-keymap (current-local-map))
    (if (not iso-latin-1-keymap)
	(setq iso-latin-1-keymap (make-sparse-keymap)))
    ;; save old defs and define new ones
    (let ((l iso-chars-alist)(c nil))
      (while l
	(setq c (car (car l)))
	(setq iso-defs-alist (cons (list c (key-binding c)) iso-defs-alist))
	(define-key iso-latin-1-keymap c 'electric-latin-1-modifier)
	(setq l (cdr l))
	))
    ;; use new local keymap
    (use-local-map iso-latin-1-keymap)
    ;; sign on 
    (message "Iso-latin-1 turned on")))

;;; reset old bindings
(defun unset-iso-defs ()
  (if (not iso-defs-alist)
      (message "not in iso-latin-1 mode")
    ;; restore old settings
    (setq ctl-arraw nil)
    (while iso-defs-alist
      (let ((c (car iso-defs-alist)))
	(define-key (current-local-map) (car c) (cadr c)))
      (setq iso-defs-alist (cdr iso-defs-alist))
      )
    (message "Iso-latin-1 turned off")))

;;; set or switch mode
(defun iso-latin-1-mode (arg)
  "Minor mode to input ISO 8859 Latin-1 8-bit chars.
Toggle iso-latin-1-mode or turn it on if optional ARG is positiv.

Iso-latin-1 mode redefines several characters, to be \"electric\". If they
form with the preceeding character a 8 bit combination defined in
iso-chars-alist, then they are replaced by the
corresponding 8 bit code. 

for example:
e' is used to type in a e-acute
c, is used to type in a \"c cedilla\".

You will need the \"8 bit\" patch to emacs and a screen font with 8
bit iso latin 1 charcater set (Sunview under SunOS 4.1, XView, vt220,
kermit 3.01,...) to see the characters."

  (interactive "P")
  (if (null arg)
      ;; toggle mode
      (if (setq iso-latin-1-mode (not iso-latin-1-mode))
	  (set-iso-defs)
	(unset-iso-defs))
    
    ;; set mode according to arg
    (if (setq iso-latin-1-mode (> (prefix-numeric-value arg) 0))
	(set-iso-defs)
      (unset-iso-defs)))
  (set-buffer-modified-p (buffer-modified-p)))

;;; Create mode control variable
(if (boundp 'iso-latin-1-mode)
    nil
  (setq minor-mode-alist (cons '(iso-latin-1-mode " latin 1")
			       minor-mode-alist))
  (make-variable-buffer-local 'iso-latin-1-mode)
  (make-variable-buffer-local 'iso-latin-1-keymap)
  (set-default 'iso-latin-1-mode nil))

----(end of iso-latin-1.el)-------------------------
