xterm-70.patch.txt

XFree86 3.9Af - xterm patch #70 - 1998/3/29 - T.Dickey <dickey@clark.net>
 
This patch corrects some minor bugs in xterm, and fills in some more details
in the VT220 emulation:
 
        + modify Imakefile to use SpecialCObjectRule for menu and data modules,
          making xterm build properly if logging is enabled.
 
          (patch by Scott Sewall <scott@iprg.nokia.com>)
 
        + restore "ich" capability to terminfo entries, since Michael Schroeder
          <Michael.Schroeder@informatik.uni-erlangen.de> points out that "ich1"
          is the one which is the problem in Solaris vi.
 
        + correct color of cursor, which would disappear on inverse-video
          since the initialization did not compare the cursor color against
          both foreground and background.
 
          reported by Olivier Calle <olivier@tc.fluke.com>
 
        + correct abbreviation-test for -version and -help options, making
          command-line option -vb work.
        
          reported by Stefan Dalibor
          <Stefan.Dalibor@informatik.uni-erlangen.de>
 
        + correct a dependency between ifdef's for OPT_I18N_SUPPORT and
          OPT_INPUT_METHOD
          
          reported by Stefan Dalibor
 
        + split-out character-set translations as new module charsets.c, to
          implement VT220 national replacement character sets (a mode where
          some of the characters are displayed as specific European glyphs). 
          This relies on xterm using an ISO 8859-1 font.
 
          suggested by Kenneth R.  Robinette <zkrr01@mailbox.neosoft.com>
 
        + correct a missing increment, which made SS2 and SS3 controls
          repeat the shifted character.
 
        + add xterm-nrc to terminfo to illustrate the VT220 national
          replacement character sets.
 
        + reformat terminfo using new ncurses tic option "-f", which makes
          if/then/else/endif expressions easier to read.
 
# ------------------------------------------------------------------------------
#  Imakefile           |   20 ++-
#  Makefile.in         |   16 +--
#  VTPrsTbl.c          |   26 ++---
#  charproc.c          |   36 +------
#  ctlseqs.ms          |   26 +++--
#  main.c              |   10 +
#  os2main.c           |   10 +
#  ptyx.h              |    1 
#  terminfo            |  209 ++++++++++++++++++++++++++++++++++++++--
#  version.h           |    2 
#  xterm-70/charsets.c |  256 ++++++++++++++++++++++++++++++++++++++++++++++++++
#  xterm.h             |    3 
#  xterm.log.html      |   40 +++++++
#  13 files changed, 573 insertions, 82 deletions
# ------------------------------------------------------------------------------
Index: Imakefile
--- xterm-69+/Imakefile Mon Mar 23 00:53:54 1998
+++ xterm-70/Imakefile  Sat Mar 28 08:38:33 1998
@@ -71,7 +71,7 @@
    MAIN_DEFINES = $(UTMPDEF) $(TTYGROUPDEF) $(PUCCPTYDDEF) $(NOPOSIXTERMIOS) \
                  -DOSMAJORVERSION=$(OSMAJORVERSION) \
                  -DOSMINORVERSION=$(OSMINORVERSION)
-   MISC_DEFINES = /* -DALLOWLOGFILEEXEC */ 
+   MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */ 
     XKB_DEFINES = XkbClientDefines
         DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT)
 
@@ -82,12 +82,16 @@
           MAINSRC = main.c
           MAINOBJ = main.o
 #endif
-          SRCS1 = button.c charproc.c cursor.c data.c doublechr.c input.c \
-                 $(MAINSRC) menu.c misc.c print.c screen.c scrollbar.c tabs.c \
-                 TekPrsTbl.c Tekproc.c util.c VTPrsTbl.c $(EXTRASRC)
-          OBJS1 = button.o charproc.o cursor.o data.o doublechr.o input.o \
-                 $(MAINOBJ) menu.o misc.o print.o screen.o scrollbar.o tabs.o \
-                 TekPrsTbl.o Tekproc.o util.o VTPrsTbl.o $(EXTRAOBJ)
+          SRCS1 = button.c charproc.c charsets.c cursor.c \
+                 data.c doublechr.c input.c \
+                 $(MAINSRC) menu.c misc.c print.c \
+                 screen.c scrollbar.c tabs.c util.c \
+                 TekPrsTbl.c Tekproc.c VTPrsTbl.c $(EXTRASRC)
+          OBJS1 = button.o charproc.o charsets.o cursor.o \
+                 data.o doublechr.o input.o \
+                 $(MAINOBJ) menu.o misc.o print.o \
+                 screen.o scrollbar.o tabs.o util.o \
+                 TekPrsTbl.o Tekproc.o VTPrsTbl.o $(EXTRAOBJ)
           SRCS2 = resize.c
           OBJS2 = resize.o
            SRCS = $(SRCS1) $(SRCS2)
@@ -113,8 +117,10 @@
 AllTarget($(PROGRAMS))
 
 SpecialCObjectRule(main,$(_NOOP_),$(MAIN_DEFINES))
+SpecialCObjectRule(menu,$(_NOOP_),$(MISC_DEFINES)) 
 SpecialCObjectRule(misc,$(_NOOP_),$(MISC_DEFINES))
 SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES))
+SpecialCObjectRule(data,$(_NOOP_),$(MISC_DEFINES)) 
 
 #if InstallXtermSetUID
 SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
Index: Makefile.in
--- xterm-69+/Makefile.in       Sun Jan 11 11:57:36 1998
+++ xterm-70/Makefile.in        Sat Mar 28 08:38:33 1998
@@ -43,12 +43,16 @@
 EXTRASRC       = @EXTRASRCS@
 EXTRAOBJ       = @EXTRAOBJS@
 
-          SRCS1 = button.c charproc.c cursor.c data.c doublechr.c input.c \
-                 main.c menu.c misc.c print.c screen.c scrollbar.c tabs.c \
-                 util.c VTPrsTbl.c $(EXTRASRC)
-          OBJS1 = button.o charproc.o cursor.o data.o doublechr.o input.o \
-                 main.o menu.o misc.o print.o screen.o scrollbar.o tabs.o \
-                 util.o VTPrsTbl.o $(EXTRAOBJ)
+          SRCS1 = button.c charproc.c charsets.c cursor.c \
+                 data.c doublechr.c input.c \
+                 $(MAINSRC) menu.c misc.c print.c \
+                 screen.c scrollbar.c tabs.c util.c \
+                 TekPrsTbl.c Tekproc.c VTPrsTbl.c $(EXTRASRC)
+          OBJS1 = button.o charproc.o charsets.o cursor.o \
+                 data.o doublechr.o input.o \
+                 main.o menu.o misc.o print.o \
+                 screen.o scrollbar.o tabs.o util.o \
+                 VTPrsTbl.o $(EXTRAOBJ)
           SRCS2 = resize.c
           OBJS2 = resize.o
            SRCS = $(SRCS1) $(SRCS2)
Index: VTPrsTbl.c
--- xterm-69+/VTPrsTbl.c        Wed Aug 27 06:48:32 1997
+++ xterm-70/VTPrsTbl.c Sat Mar 28 08:38:34 1998
@@ -4321,10 +4321,10 @@
 CASE_GSETS,
 CASE_GROUND_STATE,
 /*     4               5               6               7       */
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
+CASE_GSETS,
+CASE_GSETS,
+CASE_GSETS,
 /*     8               9               :               ;       */
 CASE_GROUND_STATE,
 CASE_GROUND_STATE,
@@ -4332,24 +4332,24 @@
 CASE_GROUND_STATE,
 /*     <               =               >               ?       */
 CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
 CASE_GROUND_STATE,
 CASE_GROUND_STATE,
 /*     @               A               B               C       */
 CASE_GROUND_STATE,
 CASE_GSETS,
 CASE_GSETS,
-CASE_GROUND_STATE,
+CASE_GSETS,
 /*     D               E               F               G       */
 CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
 CASE_GROUND_STATE,
 CASE_GROUND_STATE,
 /*     H               I               J               K       */
+CASE_GSETS,
 CASE_GROUND_STATE,
 CASE_GROUND_STATE,
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
 /*     L               M               N               O       */
 CASE_GROUND_STATE,
 CASE_GROUND_STATE,
@@ -4357,8 +4357,8 @@
 CASE_GROUND_STATE,
 /*     P               Q               R               S       */
 CASE_GROUND_STATE,
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
+CASE_GSETS,
 CASE_GROUND_STATE,
 /*     T               U               V               W       */
 CASE_GROUND_STATE,
@@ -4367,8 +4367,8 @@
 CASE_GROUND_STATE,
 /*     X               Y               Z               [       */
 CASE_GROUND_STATE,
-CASE_GROUND_STATE,
-CASE_GROUND_STATE,
+CASE_GSETS,
+CASE_GSETS,
 CASE_GROUND_STATE,
 /*     \               ]               ^               _       */
 CASE_GROUND_STATE,
Index: charproc.c
--- xterm-69+/charproc.c        Sat Mar 28 07:19:24 1998
+++ xterm-70/charproc.c Sat Mar 28 11:00:52 1998
@@ -813,7 +813,7 @@
 static void VTDestroy PROTO((Widget w));
 static Boolean VTSetValues PROTO((Widget cur, Widget request, Widget new, ArgList args, Cardinal *num_args));
 
-#if OPT_I18N_SUPPORT
+#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
 static void VTInitI18N PROTO((void));
 #endif
 
@@ -1083,6 +1083,7 @@
                                dotext(screen,
                                 screen->gsets[(int)(screen->curss)],
                                        bptr, bptr + 1);
+                               bptr += 1;
                                screen->curss = 0;
                        }
                        if(bptr < cp) {
@@ -2470,30 +2471,8 @@
        register int    n;
        register int    next_col;
 
-       switch (charset) {
-       case 'A':       /* United Kingdom set                   */
-               for (s=buf; s<ptr; ++s)
-                       if (*s == '#')
-                               *s = '\036';    /* UK pound sign*/
-               break;
-
-#if OPT_XMC_GLITCH
-       case '?':
-#endif
-       case '1':       /* Alternate Character ROM standard characters */
-       case '2':       /* Alternate Character ROM special graphics */
-       case 'B':       /* ASCII set                            */
-               break;
-
-       case '0':       /* special graphics (line drawing)      */
-               for (s=buf; s<ptr; ++s)
-                       if (*s>=0x5f && *s<=0x7e)
-                               *s = *s == 0x5f ? 0x7f : *s - 0x5f;
-               break;
-
-       default:        /* any character sets we don't recognize*/
+       if (!xtermCharSets(buf, ptr, charset))
                return;
-       }
 
        if_OPT_XMC_GLITCH(screen,{
                if (charset != '?')
@@ -2749,6 +2728,9 @@
                        screen->curses = (func == bitset);
                        update_cursesemul();
                        break;
+               case 42:                /* DECNRCM national charset (VT220) */
+                       (*func)(&termw->flags, NATIONAL);
+                       break;
                case 44:                /* margin bell                  */
                        screen->marginbell = (func == bitset);
                        if(!screen->marginbell)
@@ -3977,7 +3959,7 @@
        }
 #endif /* NO_ACTIVE_ICON */
 
-#if OPT_I18N_SUPPORT
+#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
        VTInitI18N();
 #else
        term->screen.xic = NULL;
@@ -4022,7 +4004,7 @@
        return;
 }
 
-#if OPT_I18N_SUPPORT
+#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
 static void VTInitI18N()
 {
     int                i;
@@ -5075,7 +5057,7 @@
      * not be set before the widget's realized, so it's tested separately).
      */
     if(screen->colorMode) {
-       if (TextWindow(screen) != 0 && (cc != bg)) {
+       if (TextWindow(screen) != 0 && (cc != bg) && (cc != fg)) {
            /* we might have a colored foreground/background later */
            xgcv.font = screen->fnt_norm->fid;
            mask = (GCForeground | GCBackground | GCFont);
Index: charsets.c
--- /dev/null   Sun Jul 17 19:46:18 1994
+++ xterm-70/charsets.c Sat Mar 28 08:55:25 1998
@@ -0,0 +1,256 @@
+/*
+ * $XFree86$
+ */
+
+/************************************************************
+
+Copyright 1998 by Thomas E. Dickey <dickey@clark.net>
+
+                        All Rights Reserved
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name(s) of the above copyright
+holders shall not be used in advertising or otherwise to promote the
+sale, use or other dealings in this Software without prior written
+authorization.
+
+********************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <xtermcfg.h>
+#endif
+
+#include <X11/Xos.h>
+
+#include "ptyx.h"
+#include "data.h"
+#include "xterm.h"
+
+/*
+ * This module performs translation as needed to support the DEC VT220 national
+ * replacement character sets.  We assume that xterm's font is based on the ISO
+ * 8859-1 (Latin 1) character set, which is equivalent to the DEC multinational
+ * character set.  (Glyph positions 0-31 have to be the DEC graphic characters,
+ * though).
+ *
+ * References:
+ *     "VT220 Programmer Pocket Guide" EK-VT220-HR-002 (2nd ed., 1984), which
+ *             contains character charts for the national character sets.
+ *     "VT330/VT340 Programmer Reference Manual Volume 1: Text Programming"
+ *             EK-VT3XX-TP-001 (1st ed, 1987), which contains a table (2-1)
+ *             listing the glyphs which are mapped from the multinational
+ *             character set to the national character set.
+ *
+ * The latter reference, though easier to read, has a few errors and omissions.
+ */
+int xtermCharSets(Char *buf, Char *ptr, char leftset)
+{
+       Char *s;
+       register TScreen *screen = &term->screen;
+       int count = 0;
+       int rightset = screen->gsets[(int)(screen->curgr)];
+
+       TRACE(("CHARSET %c/%c %.*s\n", leftset, rightset, ptr-buf, buf))
+
+       for (s=buf; s<ptr; ++s) {
+               int cs = (*s >= 128) ? rightset : leftset;
+
+               count++;
+               switch (cs) {
+               case 'A':       /* United Kingdom set (or Latin 1)      */
+                       if ((term->flags & NATIONAL)
+                        || (screen->ansi_level <= 1)) {
+                               *s &= 0xff;
+                               if (*s == '#')
+                                       *s = '\036';    /* UK pound sign*/
+                       } else {
+                               *s |= 0x80;
+                       }
+                       break;
+
+#if OPT_XMC_GLITCH
+               case '?':
+#endif
+               case '1':       /* Alternate Character ROM standard characters */
+               case '2':       /* Alternate Character ROM special graphics */
+               case 'B':       /* ASCII set                            */
+                       break;
+
+               case '0':       /* special graphics (line drawing)      */
+                       if (*s>=0x5f && *s<=0x7e)
+                               *s = *s == 0x5f ? 0x7f : *s - 0x5f;
+                       break;
+
+               case '4':       /* Dutch */
+                       switch (*s &= 0x7f) {
+                       case '#':       *s = 0x1e;              break;
+                       case '@':       *s = 0xbe;              break;
+                       case 0x5b:      *s = 0xff;              break;
+                       case 0x5c:      *s = 0xbd;              break;
+                       case 0x5d:      *s = '|';               break;
+                       case 0x7b:      *s = 0xa8;              break;
+                       case 0x7c:      *s = 'f';               break;
+                       case 0x7d:      *s = 0xbc;              break;
+                       case 0x7e:      *s = 0xb4;              break;
+                       }
+                       break;
+
+               case 'C':
+               case '5':       /* Finnish */
+                       switch (*s &= 0x7f) {
+                       case 0x5b:      *s = 0xc4;              break;
+                       case 0x5c:      *s = 0xd6;              break;
+                       case 0x5d:      *s = 0xc5;              break;
+                       case 0x5e:      *s = 0xdc;              break;
+                       case 0x60:      *s = 0xe9;              break;
+                       case 0x7b:      *s = 0xe4;              break;
+                       case 0x7c:      *s = 0xf6;              break;
+                       case 0x7d:      *s = 0xe5;              break;
+                       case 0x7e:      *s = 0xfc;              break;
+                       }
+                       break;
+
+               case 'R':       /* French */
+                       switch (*s &= 0x7f) {
+                       case '#':       *s = 0x1e;              break;
+                       case '@':       *s = 0xe0;              break;
+                       case 0x5b:      *s = 0xb0;              break;
+                       case 0x5c:      *s = 0xe7;              break;
+                       case 0x5d:      *s = 0xa7;              break;
+                       case 0x7b:      *s = 0xe9;              break;
+                       case 0x7c:      *s = 0xf9;              break;
+                       case 0x7d:      *s = 0xe8;              break;
+                       case 0x7e:      *s = 0xa8;              break;
+                       }
+               break;
+
+               case 'Q':       /* French Canadian */
+                       switch (*s &= 0x7f) {
+                       case '@':       *s = 0xe0;              break;
+                       case 0x5b:      *s = 0xe2;              break;
+                       case 0x5c:      *s = 0xe7;              break;
+                       case 0x5d:      *s = 0xea;              break;
+                       case 0x5e:      *s = 0xee;              break;
+                       case 0x60:      *s = 0xf4;              break;
+                       case 0x7b:      *s = 0xe9;              break;
+                       case 0x7c:      *s = 0xf9;              break;
+                       case 0x7d:      *s = 0xe8;              break;
+                       case 0x7e:      *s = 0xfb;              break;
+                       }
+                       break;
+
+               case 'K':       /* German */
+                       switch (*s &= 0x7f) {
+                       case '@':       *s = 0xa7;              break;
+                       case 0x5b:      *s = 0xc4;              break;
+                       case 0x5c:      *s = 0xd6;              break;
+                       case 0x5d:      *s = 0xdc;              break;
+                       case 0x7b:      *s = 0xe4;              break;
+                       case 0x7c:      *s = 0xf6;              break;
+                       case 0x7d:      *s = 0xfc;              break;
+                       case 0x7e:      *s = 0xdf;              break;
+                       }
+                       break;
+
+               case 'Y':       /* Italian */
+                       switch (*s &= 0x7f) {
+                       case '#':       *s = 0x1e;              break;
+                       case '@':       *s = 0xa7;              break;
+                       case 0x5b:      *s = 0xb0;              break;
+                       case 0x5c:      *s = 0xe7;              break;
+                       case 0x5d:      *s = 0xe9;              break;
+                       case 0x60:      *s = 0xf9;              break;
+                       case 0x7b:      *s = 0xe0;              break;
+                       case 0x7c:      *s = 0xf2;              break;
+                       case 0x7d:      *s = 0xe8;              break;
+                       case 0x7e:      *s = 0xec;              break;
+                       }
+                       break;
+
+               case 'E':
+               case '6':       /* Norwegian/Danish */
+                       switch (*s &= 0x7f) {
+                       case '@':       *s = 0xc4;              break;
+                       case 0x5b:      *s = 0xc6;              break;
+                       case 0x5c:      *s = 0xd8;              break;
+                       case 0x5d:      *s = 0xc5;              break;
+                       case 0x5e:      *s = 0xdc;              break;
+                       case 0x60:      *s = 0xe4;              break;
+                       case 0x7b:      *s = 0xe6;              break;
+                       case 0x7c:      *s = 0xf8;              break;
+                       case 0x7d:      *s = 0xe5;              break;
+                       case 0x7e:      *s = 0xfc;              break;
+                       }
+                       break;
+
+               case 'Z':       /* Spanish */
+                       switch (*s &= 0x7f) {
+                       case '#':       *s = 0x1e;              break;
+                       case '@':       *s = 0xa7;              break;
+                       case 0x5b:      *s = 0xa1;              break;
+                       case 0x5c:      *s = 0xd1;              break;
+                       case 0x5d:      *s = 0xbf;              break;
+                       case 0x7b:      *s = 0xb0;              break;
+                       case 0x7c:      *s = 0xf1;              break;
+                       case 0x7d:      *s = 0xe7;              break;
+                       }
+                       break;
+
+               case 'H':
+               case '7':       /* Swedish */
+                       switch (*s &= 0x7f) {
+                       case '@':       *s = 0xc9;              break;
+                       case 0x5b:      *s = 0xc4;              break;
+                       case 0x5c:      *s = 0xd6;              break;
+                       case 0x5d:      *s = 0xc5;              break;
+                       case 0x5e:      *s = 0xdc;              break;
+                       case 0x60:      *s = 0xe9;              break;
+                       case 0x7b:      *s = 0xe4;              break;
+                       case 0x7c:      *s = 0xf6;              break;
+                       case 0x7d:      *s = 0xe5;              break;
+                       case 0x7e:      *s = 0xfc;              break;
+                       }
+                       break;
+
+               case '=':       /* Swiss */
+                       switch (*s &= 0x7f) {
+                       case '#':       *s = 0xf9;              break;
+                       case '@':       *s = 0xe0;              break;
+                       case 0x5b:      *s = 0xe9;              break;
+                       case 0x5c:      *s = 0xe7;              break;
+                       case 0x5d:      *s = 0xea;              break;
+                       case 0x5e:      *s = 0xee;              break;
+                       case 0x5f:      *s = 0xe8;              break;
+                       case 0x60:      *s = 0xf4;              break;
+                       case 0x7b:      *s = 0xe4;              break;
+                       case 0x7c:      *s = 0xf6;              break;
+                       case 0x7d:      *s = 0xfc;              break;
+                       case 0x7e:      *s = 0xfb;              break;
+                       }
+                       break;
+
+               default:        /* any character sets we don't recognize*/
+                       count --;
+                       break;
+               }
+       }
+       return count;
+}
Index: ctlseqs.ms
--- xterm-69+/ctlseqs.ms        Sun Jan 25 09:19:53 1998
+++ xterm-70/ctlseqs.ms Sun Mar 29 21:02:33 1998
@@ -156,6 +156,7 @@
 .[] N N
 .[] O O
 .[] P P
+.[] Q Q
 .[] R R
 .[] S S
 .[] T T
@@ -385,27 +386,30 @@
 .
 .IP \\*(Es\\*(((\\*(Cc
 Designate G0 Character Set (ISO 2022)
-  \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set
-  \*(Cc = \*A \(-> United Kingdom (UK)
-  \*(Cc = \*(cB \(-> United States (USASCII)
-.
 .IP \\*(Es\\*)\\*(Cc
 Designate G1 Character Set (ISO 2022)
-  \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set
-  \*(Cc = \*A \(-> United Kingdom (UK)
-  \*(Cc = \*(cB \(-> United States (USASCII)
 .
 .IP \\*(Es\\**\\*(Cc
 Designate G2 Character Set (ISO 2022)
-  \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set
-  \*(Cc = \*A \(-> United Kingdom (UK)
-  \*(Cc = \*(cB \(-> United States (USASCII)
 .
 .IP \\*(Es\\*+\\*(Cc
 Designate G3 Character Set (ISO 2022)
+.br
+Final character \*(Cc for designating character sets
+(\*0, \*A and \*(cB apply to VT100 and up, the remainder to VT220 and up):
   \*(Cc = \*0 \(-> DEC Special Character and Line Drawing Set
   \*(Cc = \*A \(-> United Kingdom (UK)
   \*(Cc = \*(cB \(-> United States (USASCII)
+  \*(Cc = \*4 \(-> Dutch
+  \*(Cc = \*C or \*5 \(-> Finnish
+  \*(Cc = \*R \(-> French
+  \*(Cc = \*Q \(-> French Canadian
+  \*(Cc = \*K \(-> German
+  \*(Cc = \*Y \(-> Italian
+  \*(Cc = \*E or \*6 \(-> Norwegian/Danish
+  \*(Cc = \*Z \(-> Spanish
+  \*(Cc = \*H or \*7 \(-> Swedish
+  \*(Cc = \*= \(-> Swiss
 .
 .IP \\*(Es\\*7
 Save Cursor (DECSC)
@@ -771,6 +775,7 @@
   \*(Ps = \*3\*8 \(-> Enter Tektronix Mode (DECTEK)
   \*(Ps = \*4\*0 \(-> Allow 80 \z\(<-\(-> 132 Mode
   \*(Ps = \*4\*1 \(-> \fImore\fP(1) fix (see \fIcurses\fP resource)
+  \*(Ps = \*4\*2 \(-> Enable Nation Replacement Character sets (DECNRCM)
   \*(Ps = \*4\*4 \(-> Turn On Margin Bell
   \*(Ps = \*4\*5 \(-> Reverse-wraparound Mode
   \*(Ps = \*4\*6 \(-> Start Logging
@@ -803,6 +808,7 @@
   \*(Ps = \*2\*5 \(-> Hide Cursor (DECTCEM)
   \*(Ps = \*4\*0 \(-> Disallow 80 \z\(<-\(-> 132 Mode
   \*(Ps = \*4\*1 \(-> No \fImore\fP(1) fix (see \fIcurses\fP resource)
+  \*(Ps = \*4\*2 \(-> Disable Nation Replacement Character sets (DECNRCM)
   \*(Ps = \*4\*4 \(-> Turn Off Margin Bell
   \*(Ps = \*4\*5 \(-> No Reverse-wraparound Mode
   \*(Ps = \*4\*6 \(-> Stop Logging
Index: main.c
--- xterm-69+/main.c    Sat Mar 28 07:19:24 1998
+++ xterm-70/main.c     Sat Mar 28 08:38:34 1998
@@ -976,6 +976,12 @@
 "will be started.  Options that start with a plus sign (+) restore the default.",
 NULL};
 
+static int abbrev (char *tst, char *cmp)
+{
+       size_t len = strlen(tst);
+       return ((len >= 2) && (!strncmp(tst, cmp, len)));
+}
+
 static void Syntax (badOption)
     char *badOption;
 {
@@ -1115,9 +1121,9 @@
        /* Do these first, since we may not be able to open the display */
        ProgramName = argv[0];
        if (argc > 1) {
-               if (!strncmp(argv[1], "-v", 2))
+               if (abbrev(argv[1], "-version"))
                        Version();
-               if (!strncmp(argv[1], "-h", 2) && strncmp(argv[1], "-hc", 3))
+               if (abbrev(argv[1], "-help"))
                        Help();
        }
 
Index: os2main.c
--- xterm-69+/os2main.c Sat Mar 28 07:19:24 1998
+++ xterm-70/os2main.c  Sat Mar 28 08:38:34 1998
@@ -517,6 +517,12 @@
 "will be started.  Options that start with a plus sign (+) restore the default.",
 NULL};
 
+static int abbrev (char *tst, char *cmp)
+{
+       size_t len = strlen(tst);
+       return ((len >= 2) && (!strncmp(tst, cmp, len)));
+}
+
 static void Syntax (badOption)
     char *badOption;
 {
@@ -772,9 +778,9 @@
        /* Do these first, since we may not be able to open the display */
        ProgramName = argv[0];
        if (argc > 1) {
-               if (!strncmp(argv[1], "-v", 2))
+               if (abbrev(argv[1], "-version"))
                        Version();
-               if (!strncmp(argv[1], "-h", 2) && strncmp(argv[1], "-hc", 3))
+               if (abbrev(argv[1], "-help"))
                        Help();
        }
 
Index: ptyx.h
--- xterm-69+/ptyx.h    Sat Mar 28 07:19:24 1998
+++ xterm-70/ptyx.h     Sat Mar 28 08:38:34 1998
@@ -928,6 +928,7 @@
 #define SMOOTHSCROLL   0x10000 /* true if in smooth scroll mode */
 #define IN132COLUMNS   0x20000 /* true if in 132 column mode */
 #define INVISIBLE      0x40000 /* true if writing invisible text */
+#define NATIONAL       0x100000        /* true if writing national charset */
 
 /*
  * Per-line flags
Index: terminfo
--- xterm-69+/terminfo  Mon Mar 23 00:53:54 1998
+++ xterm-70/terminfo   Sun Mar 29 19:15:33 1998
@@ -64,6 +64,7 @@
        hpa=\E[%i%p1%dG,
        ht=^I,
        hts=\EH,
+       ich=\E[%p1%d@,
        il=\E[%p1%dL,
        il1=\E[L,
        ind=^J,
@@ -109,7 +110,7 @@
        knp=\E[6~,
        kpp=\E[5~,
        kslt=\E[4~,
-       mc0=\E[i, 
+       mc0=\E[i,
        mc4=\E[4i,
        mc5=\E[5i,
        meml=\El,
@@ -130,9 +131,45 @@
        sc=\E7,
        setab=\E[4%p1%dm,
        setaf=\E[3%p1%dm,
-       setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-       setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-       sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
+       setb=\E[4
+               %?%p1%{1}%=
+                       %t4
+                       %e%p1%{3}%=
+                       %t6
+                       %e%p1%{4}%=
+                       %t1
+                       %e%p1%{6}%=
+                       %t3
+                       %e%p1%d
+               %;m,
+       setf=\E[3
+               %?%p1%{1}%=
+                       %t4
+                       %e%p1%{3}%=
+                       %t6
+                       %e%p1%{4}%=
+                       %t1
+                       %e%p1%{6}%=
+                       %t3
+                       %e%p1%d
+               %;m,
+       sgr=\E[0
+               %?%p1%p6%|
+                       %t;1
+               %;
+               %?%p2
+                       %t;4
+               %;
+               %?%p1%p3%|
+                       %t;7
+               %;
+               %?%p4
+                       %t;5
+               %;m
+               %?%p9
+                       %t\016
+                       %e\017
+               %;,
        sgr0=\E[m\017,
        smacs=^N,
        smam=\E[?7h,
@@ -196,6 +233,78 @@
        rep=%p1%c\E[%p2%{1}%-%db,
        use=xterm,
 #
+# This is mainly for testing xterm; the real VT220 will not let you switch
+# character sets without first altering the keyboard language in the setup
+# screen.  Some emulators allow this anyway.  (Note that these strings are
+# normally used only for printers).  The parameter to csnm and scs is the same
+# in both cases:  the keyboard language parameter returned by CSI ? 2 6 n.
+xterm-nrc|xterm with VT220 national replacement character sets,
+       csnm=
+               %?%p1%{1}%=
+                       %tNorth American
+                       %e%p1%{2}%=
+                       %tBritish
+                       %e%p1%{3}%=
+                       %tFlemish
+                       %e%p1%{4}%=
+                       %tFrench Canadian
+                       %e%p1%{5}%=
+                       %tDanish
+                       %e%p1%{6}%=
+                       %tFinnish
+                       %e%p1%{7}%=
+                       %tGerman
+                       %e%p1%{8}%=
+                       %tDutch
+                       %e%p1%{9}%=
+                       %tItalian
+                       %e%p1%{10}%=
+                       %tSwiss (French)
+                       %e%p1%{11}%=
+                       %tSwiss (German)
+                       %e%p1%{12}%=
+                       %tSwedish
+                       %e%p1%{13}%=
+                       %tNorwegian
+                       %e%p1%{14}%=
+                       %tFrench/Belgian
+                       %e%p1%{15}%=
+                       %tSpanish
+               %;,
+       scs=
+               %?%p1%{1}%=
+                       %t\E(B
+                       %e%p1%{2}%=
+                       %t\E(A
+                       %e%p1%{3}%=
+                       %t\E(R
+                       %e%p1%{4}%=
+                       %t\E(9
+                       %e%p1%{5}%=
+                       %t\E(E
+                       %e%p1%{6}%=
+                       %t\E(5
+                       %e%p1%{7}%=
+                       %t\E(K
+                       %e%p1%{8}%=
+                       %t\E(4
+                       %e%p1%{9}%=
+                       %t\E(Y
+                       %e%p1%{10}%=
+                       %t\E(=
+                       %e%p1%{11}%=
+                       %t\E(=
+                       %e%p1%{12}%=
+                       %t\E(7
+                       %e%p1%{13}%=
+                       %t\E(E
+                       %e%p1%{14}%=
+                       %t\E(R
+                       %e%p1%{15}%=
+                       %t\E(Z
+               %;,
+       use=xterm,
+#
 # Foreground 0-15 maps (with toggles) into 30-37 & 90-97
 # Background 0-15 maps (with toggles) into 40-47 & 100-107
 # We should not have to suppress setaf/setab, however ncurses selects these
@@ -208,8 +317,28 @@
        pairs#256,
        setab@,
        setaf@,
-       setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m,
-       setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m,
+       setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa
+               %?%ga%{1}%=
+                       %t4
+                       %e%ga%{3}%=
+                       %t6
+                       %e%ga%{4}%=
+                       %t1
+                       %e%ga%{6}%=
+                       %t3
+                       %e%ga%d
+               %;m,
+       setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa
+               %?%ga%{1}%=
+                       %t4
+                       %e%ga%{3}%=
+                       %t6
+                       %e%ga%{4}%=
+                       %t1
+                       %e%ga%{6}%=
+                       %t3
+                       %e%ga%d
+               %;m,
        use=xterm,
 # This is an 8-bit version of xterm, which emulates DEC vt220 with ANSI color.
 # To use it, your decTerminalID resource must be set to 200 or above.
@@ -265,10 +394,11 @@
        hpa=\233%i%p1%dG,
        ht=^I,
        hts=\210,
+       ich=\233%p1%d@,
        il=\233%p1%dL,
        il1=\233L,
        ind=^J,
-       is2=\E7\E\sG\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>,
+       is2=\E7\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>,
        ka1=\217w,
        ka3=\217u,
        kb2=\217y,
@@ -310,7 +440,7 @@
        knp=\2336~,
        kpp=\2335~,
        kslt=\2334~,
-       mc0=\233i, 
+       mc0=\233i,
        mc4=\2334i,
        mc5=\2335i,
        meml=\El,
@@ -327,14 +457,50 @@
        rmso=\23327m,
        rmul=\23324m,
        rs1=\Ec,
-       rs2=\E7\E[62"p\E\sG\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>,
+       rs2=\E7\E[62"p\E G\233r\233m\233?7h\233?1;3;4;6l\2334l\E8\E>,
        sc=\E7,
        setab=\2334%p1%dm,
        setaf=\2333%p1%dm,
-       setb=\2334%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-       setf=\2333%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-       sgr=\2330%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;,
-       sgr0=\233m\017,
+       setb=\2334
+               %?%p1%{1}%=
+                       %t4
+                       %e%p1%{3}%=
+                       %t6
+                       %e%p1%{4}%=
+                       %t1
+                       %e%p1%{6}%=
+                       %t3
+                       %e%p1%d
+               %;m,
+       setf=\2333
+               %?%p1%{1}%=
+                       %t4
+                       %e%p1%{3}%=
+                       %t6
+                       %e%p1%{4}%=
+                       %t1
+                       %e%p1%{6}%=
+                       %t3
+                       %e%p1%d
+               %;m,
+       sgr=\2330
+               %?%p1%p6%|
+                       %t;1
+               %;
+               %?%p2
+                       %t;4
+               %;
+               %?%p1%p3%|
+                       %t;7
+               %;
+               %?%p4
+                       %t;5
+               %;m
+               %?%p9
+                       %t\016
+                       %e\017
+               %;,
+       sgr0=\233m^O,
        smacs=^N,
        smam=\233?7h,
        smcup=\233?1048h\233?1047h,
@@ -506,7 +672,22 @@
        rmso=\E[m,
        rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
        sc=\E7,
-       sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m,
+       sgr=\E[
+               %?%p1
+                       %t;7
+               %;
+               %?%p2
+                       %t;4
+               %;
+               %?%p3
+                       %t;7
+               %;
+               %?%p4
+                       %t;5
+               %;
+               %?%p6
+                       %t;1
+               %;m,
        sgr0=\E[m,
        smkx=\E[?1h\E=,
        smso=\E[7m,
Index: version.h
--- xterm-69+/version.h Mon Mar 23 00:53:54 1998
+++ xterm-70/version.h  Sat Mar 28 10:24:16 1998
@@ -6,4 +6,4 @@
  * version of xterm has been built.  The number in parentheses is my patch
  * number (T.Dickey).
  */
-#define XTERM_VERSION "XFree86 3.9Ad(69)"
+#define XTERM_VERSION "XFree86 3.9Af(70)"
Index: xterm.h
--- xterm-69+/xterm.h   Sat Mar 28 07:19:24 1998
+++ xterm-70/xterm.h    Sat Mar 28 08:38:34 1998
@@ -107,6 +107,9 @@
 extern void SGR_Foreground PROTO((int color));
 #endif
 
+/* charsets.c */
+extern int xtermCharSets (Char *buf, Char *ptr, char charset);
+
 /* cursor.c */
 extern void CarriageReturn PROTO((TScreen *screen));
 extern void CursorBack PROTO((TScreen *screen, int  n));
Index: xterm.log.html
--- xterm-69+/xterm.log.html    Mon Mar 23 00:53:54 1998
+++ xterm-70/xterm.log.html     Sun Mar 29 21:19:27 1998
@@ -41,6 +41,7 @@
 xc/programs/Xserver/hw/xfree86).
 
 <UL>
+<LI><A HREF="#xterm_70">Patch #70 - 1998/3/29 - XFree86 3.9Af and 3.3.2</A>
 <LI><A HREF="#xterm_69">Patch #69 - 1998/3/16 - XFree86 3.9Ad and 3.3.2</A>
 <LI><A HREF="#xterm_68">Patch #68 - 1998/3/4 - XFree86 3.9Ad and 3.3.1z</A>
 <LI><A HREF="#xterm_67">Patch #67 - 1998/2/23 - XFree86 3.9Ad and 3.3.1e</A>
@@ -110,6 +111,45 @@
 <LI><A HREF="#xterm_03">Patch #3 - 1996/1/7</A>
 <LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
 <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
+</UL>
+
+<H1><A NAME="xterm_70">Patch #70 - 1998/3/29 - XFree86 3.9Af and 3.3.2</A></H1>
+
+This patch corrects some minor bugs in xterm, and fills in some more details
+in the VT220 emulation:
+<UL>
+       <LI>modify Imakefile to use SpecialCObjectRule for menu and data modules,
+         making xterm build properly if logging is enabled
+         (patch by Scott Sewall &lt;scott@iprg.nokia.com&gt;).
+
+       <LI>restore "ich" capability to terminfo entries, since
+         Michael Schroeder points out that "ich1"
+         is the one which is the problem in Solaris vi.
+
+       <LI>correct color of cursor, which would disappear on inverse-video
+         since the initialization did not compare the cursor color against
+         both foreground and background (reported by Olivier Calle).
+
+       <LI>correct abbreviation-test for -version and -help options, making
+         command-line option -vb work (reported by Stefan Dalibor).
+
+       <LI>correct a dependency between ifdef's for OPT_I18N_SUPPORT and
+         OPT_INPUT_METHOD (reported by Stefan Dalibor).
+
+       <LI>split-out character-set translations as new module charsets.c, to
+         implement VT220 national replacement character sets (a mode where
+         some of the characters are displayed as specific European glyphs).
+         This relies on xterm using an ISO 8859-1 font (approach suggested by
+         Kenneth R. Robinette &lt;zkrr01@mailbox.neosoft.com&gt;).
+
+       <LI>correct a missing increment, which made SS2 and SS3 controls
+         repeat the shifted character.
+
+       <LI>add xterm-nrc to terminfo to illustrate the VT220 national
+         replacement character sets.
+
+       <LI>reformat terminfo using new ncurses tic option "-f", which makes
+         if/then/else/endif expressions easier to read.
 </UL>
 
 <H1><A NAME="xterm_69">Patch #69 - 1998/3/16 - XFree86 3.9Ad and 3.3.2</A></H1>