]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20081129
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 30 Nov 2008 00:38:32 +0000 (00:38 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 30 Nov 2008 00:38:32 +0000 (00:38 +0000)
+ improve a workaround in adding wide-characters, when a control
  character is found.  The library (cf: 20040207) uses unctrl() to
  obtain a printable version of the control character, but was not
  passing color or video attributes.
+ improve test/ncurses.c 'a' test, using unctrl() more consistently to
  display meta-characters.
+ turn on _XOPEN_CURSES definition in curses.h
+ add eterm-color entry (report by Vincent Lefevre) -TD
+ correct use of key_name() in test/ncurses.c 'A' test, which only
  displays wide-characters, not key-codes since 20070612 (report by
  Ricardo Cantu).

NEWS
TO-DO
dist.mk
include/curses.h.in
include/curses.wide
misc/terminfo.src
ncurses/base/lib_addch.c
test/ncurses.c

diff --git a/NEWS b/NEWS
index caf4acfb4f3054d7c684fb3879a41ea94e9df34a..abb90aac8b7ebc40775ffcad1be6d85c48897f9f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1325 2008/11/23 00:20:04 tom Exp $
+-- $Id: NEWS,v 1.1330 2008/11/29 21:08:00 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,19 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20081129
+       + improve a workaround in adding wide-characters, when a control
+         character is found.  The library (cf: 20040207) uses unctrl() to
+         obtain a printable version of the control character, but was not
+         passing color or video attributes.
+       + improve test/ncurses.c 'a' test, using unctrl() more consistently to
+         display meta-characters.
+       + turn on _XOPEN_CURSES definition in curses.h
+       + add eterm-color entry (report by Vincent Lefevre) -TD
+       + correct use of key_name() in test/ncurses.c 'A' test, which only
+         displays wide-characters, not key-codes since 20070612 (report by
+         Ricardo Cantu).
+
 20081122
        + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and
          Ada95 (patch by Juergen Pfeifer).
diff --git a/TO-DO b/TO-DO
index 4b492b6a4d08752b9a7f21d13a6458052f43ce96..eb25227967083141e21205e31b50db13aa412bcd 100644 (file)
--- a/TO-DO
+++ b/TO-DO
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: TO-DO,v 1.52 2008/11/22 22:58:59 tom Exp $
+-- $Id: TO-DO,v 1.53 2008/11/28 16:39:12 tom Exp $
 -------------------------------------------------------------------------------
 
 SHORT-TERM TO-DO ITEMS:
@@ -45,7 +45,7 @@ Known Problems:
 + Scrolling optimization has holes:  for example, it forces repaints of the
   screen between calls to refresh().
 
-+ SVr4 uses slightly different rules for determining when softkeys are shown. 
++ SVr4 uses slightly different rules for determining when softkeys are shown.
   For example, they are initially displayed (before the ncurses 'e' test
   activates them), and a touchwin can apparently also force them to be
   displayed.
@@ -58,7 +58,7 @@ Known Problems:
 + The window classes defined in the c++ subdirectory need documentation.  Some
   C++ programmer could earn a lot of good karma by doing this...
 
-+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. 
++ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
   There appear to be no terminals that require that functionality.
 
 + the configure --disable-ext-funcs option does not work for Ada95 tree.
@@ -69,7 +69,7 @@ Known Problems:
 + the Ada95 tree requires a small fix to build on Cygwin, since the GNAT port
   to that platform provides an incomplete Interrupts.Names package.  For
   instance (your gcc version may be different):
-        /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads        
+        /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
 
   cut here...
 -------------------------------------------------------------------------------
@@ -79,7 +79,7 @@ Known Problems:
 
     DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1;
     DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2;
-+   SIGINT : constant Interrupt_ID := 1;
++   SIGINT : constant Interrupt_ID := 2;
 
  end Ada.Interrupts.Names;
 -------------------------------------------------------------------------------
@@ -140,7 +140,7 @@ supporting internationalization.
 2. DOS port
 
 Only a few of the files in the library depend on the terminfo format.
-It should be possible to further kernelize the package, then rewrite 
+It should be possible to further kernelize the package, then rewrite
 a small number of core files to produce a functionally-compatible
 port that would do updates to a memory-mapped screen area.  The first
 result of this would be a DOS port.
@@ -213,10 +213,10 @@ F. Unused VDT capabilities:
                move_insert, dest_tabs_magic_smso, transparent_underline,
                needs_xon_xoff, hard_cursor.
        Numerics: lines_of_memory, buttons.
-       Strings: pkey_key, pkey_local, pkey_xmit, underline_char, 
-               enter_xon_mode, exit_xon_mode, xon_character, xoff_character, 
+       Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
+               enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
                display_clock, remove_clock, user[0-5], display_pc_char,
-               enter_scancode_mode, exit_scancode_mode, pc_term_options, 
+               enter_scancode_mode, exit_scancode_mode, pc_term_options,
                scancode_escape, alt_scancode_esc.
 
 These are the potentially important ones for ncurses.  Notes:
diff --git a/dist.mk b/dist.mk
index a791c4804b5b73ce6e3e761af6fb5ca4b4be76cb..c5fb80cecd25d6b0624d8c8c95413ab75761eab9 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.673 2008/11/22 19:33:58 tom Exp $
+# $Id: dist.mk,v 1.674 2008/11/28 16:15:46 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20081122
+NCURSES_PATCH = 20081129
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 53da9a564fe50d71df90b038df8e7ffc9a63938e..17e0c9f4b9e94f169f766aa9b23002e3d537e6c0 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.187 2008/08/30 20:11:29 tom Exp $ */
+/* $Id: curses.h.in,v 1.189 2008/11/29 18:35:46 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
 #define CURSES 1
 #define CURSES_H 1
 
-/* This should be defined for the enhanced functionality to be visible.
- * However, some of the wide-character (enhanced) functionality is missing.
- * So we do not define it (yet).
-#define _XOPEN_CURSES 1
- */
-
 /* These are defined only in curses.h, and are used for conditional compiles */
 #define NCURSES_VERSION_MAJOR @NCURSES_MAJOR@
 #define NCURSES_VERSION_MINOR @NCURSES_MINOR@
index 0c799e4f395cd283a9d74f864a8c4b9d1989a941..7d11403471e9ed77b9ca22cee4ebd1822d696184 100644 (file)
@@ -1,9 +1,11 @@
-/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */
+/* $Id: curses.wide,v 1.36 2008/11/29 18:44:08 tom Exp $ */
 /*
  * vile:cmode:
  * This file is part of ncurses, designed to be appended after curses.h.in
  * (see that file for the relevant copyright).
  */
+#define _XOPEN_CURSES 1
+
 #ifdef _XOPEN_SOURCE_EXTENDED
 
 extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
index aa01db0479b71516caa1e2c871f654ca25622014..f58fd4d633833a60aabbb428194b97bddc2c0a6e 100644 (file)
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
-#      $Revision: 1.342 $
-#      $Date: 2008/11/15 21:54:35 $
+#      $Revision: 1.343 $
+#      $Date: 2008/11/29 15:27:35 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -4357,6 +4357,26 @@ eterm|gnu emacs term.el terminal emulation,
        sgr0=\E[m, smcup=\E7\E[?47h, smir=\E[4h, smso=\E[7m,
        smul=\E[4m,
 
+# The codes supported by the term.el terminal emulation in GNU Emacs 22.2
+eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
+       am, mir, msgr, xenl,
+       colors#8, cols#80, lines#24, pairs#64,
+       bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
+       csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+       cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
+       cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+       dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
+       el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@,
+       il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kbs=\177,
+       kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+       kdch1=\E[3~, kend=\E[4~, khome=\E[1~, kich1=\E[2~,
+       knp=\E[6~, kpp=\E[5~, op=\E[39;49m, rc=\E8, rev=\E[7m,
+       ri=\EM, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+       sc=\E7, setab=\E[%p1%'('%+%dm, setaf=\E[%p1%{30}%+%dm,
+       sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m,
+       sgr0=\E[m, smir=\E[4h, smso=\E[7m, smul=\E[4m,
+       u6=\E[%i%d;%dR, u7=\E[6n,
+
 # Entries for use by the `screen' program by Juergen Weigert,
 # Michael Schroeder, Oliver Laumann.  The screen and
 # screen-w entries came with version 3.7.1.  The screen2 and screen3 entries
@@ -21795,6 +21815,9 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 #      * change several \E[2g (clear tab at current column) to \E[3g
 #        (clear all tabs) to match definition for tbc capability -TD
 #
+# 2008-11-29
+#      * add eterm-color -TD
+#
 # The following sets edit modes for GNU EMACS.
 # Local Variables:
 # fill-prefix:"\t"
index 20a97a01a0112a2595852728d87fd719e44d59a0..3accc043d9bc0d528e74ad88db406d9e5d877f74 100644 (file)
@@ -36,7 +36,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_addch.c,v 1.113 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.114 2008/11/29 21:02:10 tom Exp $")
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
@@ -265,15 +265,25 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
            int len = _nc_build_wch(win, CHREF(ch));
 
            if (len >= -1) {
-               /* handle EILSEQ */
+               attr_t attr = AttrOf(ch);
+
+               /* handle EILSEQ (i.e., when len >= -1) */
                if (is8bits(CharOf(ch))) {
+                   int rc = OK;
                    const char *s = unctrl((chtype) CharOf(ch));
-                   if (s[1] != 0) {
-                       return waddstr(win, s);
+
+                   if (s[1] != '\0') {
+                       while (*s != '\0') {
+                           rc = waddch(win, UChar(*s) | attr);
+                           if (rc != OK)
+                               break;
+                           ++s;
+                       }
+                       return rc;
                    }
                }
                if (len == -1)
-                   return waddch(win, ' ');
+                   return waddch(win, ' ' | attr);
            } else {
                return OK;
            }
index 3fd7dfae705b07c06f4dac383f55e09da374b94b..6d0d9355b9c06debf88d9011f002821b3e674ff3 100644 (file)
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.329 2008/09/27 14:34:58 tom Exp $
+$Id: ncurses.c,v 1.332 2008/11/29 20:08:42 tom Exp $
 
 ***************************************************************************/
 
@@ -569,8 +569,11 @@ mouse_decode(MEVENT const *ep)
  *
  ****************************************************************************/
 
+#define NUM_GETCH_FLAGS 256
+typedef bool GetchFlags[NUM_GETCH_FLAGS];
+
 static void
-setup_getch(WINDOW *win, bool flags[])
+setup_getch(WINDOW *win, GetchFlags flags)
 {
     keypad(win, flags['k']);   /* should be redundant, but for testing */
     meta(win, flags['m']);     /* force this to a known state */
@@ -581,7 +584,17 @@ setup_getch(WINDOW *win, bool flags[])
 }
 
 static void
-wgetch_help(WINDOW *win, bool flags[])
+init_getch(WINDOW *win, GetchFlags flags)
+{
+    memset(flags, FALSE, NUM_GETCH_FLAGS);
+    flags[UChar('k')] = (win == stdscr);
+    flags[UChar('m')] = TRUE;
+
+    setup_getch(win, flags);
+}
+
+static void
+wgetch_help(WINDOW *win, GetchFlags flags)
 {
     static const char *help[] =
     {
@@ -731,13 +744,10 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
     int first_y, first_x;
     int c;
     int incount = 0;
-    bool flags[256];
+    GetchFlags flags;
     bool blocking = (delay < 0);
 
-    memset(flags, FALSE, sizeof(flags));
-    flags[UChar('k')] = (win == stdscr);
-
-    setup_getch(win, flags);
+    init_getch(win, flags);
     wtimeout(win, delay);
     getyx(win, first_y, first_x);
 
@@ -835,12 +845,18 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
                }
 #endif
                (void) waddstr(win, keyname(c));
-           } else if (c > 0x80) {
-               unsigned c2 = (unsigned) (c & 0x7f);
-               if (isprint(c2))
-                   (void) wprintw(win, "M-%c", UChar(c2));
-               else
+           } else if (c >= 0x80) {
+               unsigned c2 = (unsigned) c;
+#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES))
+               /* at least Solaris SVR4 curses breaks unctrl(128), etc. */
+               c2 &= 0x7f;
+#endif
+               if (isprint(c))
+                   (void) wprintw(win, "%c", UChar(c));
+               else if (c2 != UChar(c))
                    (void) wprintw(win, "M-%s", unctrl(c2));
+               else
+                   (void) wprintw(win, "%s", unctrl(c2));
                waddstr(win, " (high-half character)");
            } else {
                if (isprint(c))
@@ -854,6 +870,9 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
     }
 
     wtimeout(win, -1);
+
+    if (!level)
+       init_getch(win, flags);
 }
 
 static int
@@ -978,15 +997,12 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
     int first_y, first_x;
     wint_t c;
     int incount = 0;
-    bool flags[256];
+    GetchFlags flags;
     bool blocking = (delay < 0);
     int y, x, code;
     char *temp;
 
-    memset(flags, FALSE, sizeof(flags));
-    flags[UChar('k')] = (win == stdscr);
-
-    setup_getch(win, flags);
+    init_getch(win, flags);
     wtimeout(win, delay);
     getyx(win, first_y, first_x);
 
@@ -1096,14 +1112,14 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
                    resize_wide_boxes(level, win);
                }
 #endif
-               (void) waddstr(win, key_name((wchar_t) c));
+               (void) waddstr(win, keyname((wchar_t) c));
            } else {
+               (void) waddstr(win, key_name((wchar_t) c));
                if (c < 256 && iscntrl(c)) {
-                   (void) wprintw(win, "%s (control character)", unctrl(c));
+                   (void) wprintw(win, " (control character)");
                } else {
-                   wchar_t c2 = (wchar_t) c;
-                   waddnwstr(win, &c2, 1);
-                   (void) wprintw(win, " = %#x (printable character)", (unsigned) c);
+                   (void) wprintw(win, " = %#x (printable character)",
+                                  (unsigned) c);
                }
            }
            wgetch_wrap(win, first_y);
@@ -1111,6 +1127,9 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
     }
 
     wtimeout(win, -1);
+
+    if (!level)
+       init_getch(win, flags);
 }
 
 static void
@@ -3238,7 +3257,7 @@ show_1_wacs(int n, int repeat, const char *name, const cchar_t *code)
     int col = (n / height) * COLS / 2;
 
     mvprintw(row, col, "%*s : ", COLS / 4, name);
-    while (repeat-- >= 0) {
+    while (--repeat >= 0) {
        add_wch(code);
     }
     return n + 1;