4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Our own function to determine width of Unicode characters may get
12 outdated. (Markus Kuhn)
13 Solution: Use wcwidth() when it is available. Also use iswprint().
14 Files: src/auto/configure, src/configure.in, src/config.h.in, src/mbyte.c
17 *** ../vim-6.2.403/src/auto/configure Tue Mar 16 18:03:23 2004
18 --- src/auto/configure Fri Mar 26 13:15:11 2004
21 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
22 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
23 libgen.h util/debug.h util/msg18n.h frame.h \
24 ! sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h
26 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
27 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
28 ! echo "configure:5421: checking for $ac_hdr" >&5
29 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
30 echo $ac_n "(cached) $ac_c" 1>&6
32 cat > conftest.$ac_ext <<EOF
33 ! #line 5426 "configure"
37 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
38 ! { (eval echo configure:5431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
39 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
40 if test -z "$ac_err"; then
43 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
44 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
45 libgen.h util/debug.h util/msg18n.h frame.h \
46 ! sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h
48 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
49 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
50 ! echo "configure:5574: checking for $ac_hdr" >&5
51 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
52 echo $ac_n "(cached) $ac_c" 1>&6
54 cat > conftest.$ac_ext <<EOF
55 ! #line 5579 "configure"
59 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
60 ! { (eval echo configure:5584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
61 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
62 if test -z "$ac_err"; then
64 *** ../vim-6.2.403/src/configure.in Tue Mar 16 18:03:23 2004
65 --- src/configure.in Fri Mar 26 13:12:08 2004
68 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
69 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
70 libgen.h util/debug.h util/msg18n.h frame.h \
71 ! sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h)
73 dnl On Mac OS X strings.h exists but produces a warning message :-(
74 if test "x$MACOSX" != "xyes"; then
76 sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h \
77 poll.h sys/poll.h pwd.h utime.h sys/param.h libintl.h \
78 libgen.h util/debug.h util/msg18n.h frame.h \
79 ! sys/acl.h sys/access.h sys/sysctl.h sys/sysinfo.h wchar.h)
81 dnl On Mac OS X strings.h exists but produces a warning message :-(
82 if test "x$MACOSX" != "xyes"; then
83 *** ../vim-6.2.403/src/config.h.in Sun May 25 18:07:42 2003
84 --- src/config.h.in Fri Mar 26 13:14:12 2004
88 #undef HAVE_SYS_SYSTEMINFO_H
89 #undef HAVE_SYS_TIME_H
90 #undef HAVE_SYS_UTSNAME_H
95 *** ../vim-6.2.403/src/mbyte.c Sun Mar 14 20:12:26 2004
96 --- src/mbyte.c Fri Mar 26 14:06:44 2004
103 + #ifdef HAVE_WCHAR_H
104 + # include <wchar.h>
107 #if defined(FEAT_MBYTE) || defined(PROTO)
109 static int enc_canon_search __ARGS((char_u *name));
112 {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665},
113 {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F},
114 {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF},
120 if (!utf_printable(c))
121 return 6; /* unprintable, displays <xxxx> */
124 {0x2642, 0x2642}, {0x2660, 0x2661}, {0x2663, 0x2665},
125 {0x2667, 0x266A}, {0x266C, 0x266D}, {0x266F, 0x266F},
126 {0x273D, 0x273D}, {0x2776, 0x277F}, {0xE000, 0xF8FF},
127 ! {0xFFFD, 0xFFFD}, /* {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD} */
132 + #ifdef __STDC_ISO_10646__
134 + * Assume the library function wcwidth() works better than our own
135 + * stuff. It should return 1 for ambiguous width chars!
137 + int n = wcwidth(c);
140 + return 6; /* unprintable, displays <xxxx> */
144 if (!utf_printable(c))
145 return 6; /* unprintable, displays <xxxx> */
149 || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
150 || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
151 || (c >= 0xffe0 && c <= 0xffe6)
152 ! || (c >= 0x20000 && c <= 0x2ffff)))
156 /* Characters below 0x100 are influenced by 'isprint' option */
158 || (c >= 0xfe30 && c <= 0xfe6f) /* CJK Compatibility Forms */
159 || (c >= 0xff00 && c <= 0xff60) /* Fullwidth Forms */
160 || (c >= 0xffe0 && c <= 0xffe6)
161 ! || (c >= 0x20000 && c <= 0x2fffd)
162 ! || (c >= 0x30000 && c <= 0x3fffd)))
167 /* Characters below 0x100 are influenced by 'isprint' option */
174 + #ifdef __STDC_ISO_10646__
176 + * Assume the iswprint() library function works better than our own stuff.
178 + return iswprint(c);
180 /* Sorted list of non-overlapping intervals.
181 * 0xd800-0xdfff is reserved for UTF-16, actually illegal. */
182 static struct interval nonprint[] =
188 return !intable(nonprint, sizeof(nonprint), c);
197 /* sorted list of non-overlapping intervals */
198 ! static struct interval
200 unsigned short first;
205 /* sorted list of non-overlapping intervals */
206 ! static struct clinterval
208 unsigned short first;
212 {0xff5b, 0xff65, 1}, /* half/fullwidth ASCII */
215 ! int top = sizeof(classes) / sizeof(struct interval) - 1;
218 /* First quick check for Latin1 characters, use 'iskeyword'. */
220 {0xff5b, 0xff65, 1}, /* half/fullwidth ASCII */
223 ! int top = sizeof(classes) / sizeof(struct clinterval) - 1;
226 /* First quick check for Latin1 characters, use 'iskeyword'. */
227 *** ../vim-6.2.403/src/version.c Fri Mar 26 10:38:21 2004
228 --- src/version.c Fri Mar 26 14:22:51 2004
232 { /* Add new patch number below this line */
238 You are not really successful until someone claims he sat
239 beside you in school.
241 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
242 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
243 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
244 \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///