home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.221 < prev    next >
Encoding:
Internet Message Format  |  2002-10-12  |  50.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.221
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.221
  11. Problem:    Changing case may not work properly, depending on the current
  12.         locale.
  13. Solution:   Add the 'casemap' option to let the user chose how changing case
  14.         is to be done.
  15.         Also fix lowering case when an UTF-8 character doesn't keep the
  16.         same byte length.
  17. Files:        runtime/doc/options.txt, src/ascii.h, src/auto/configure,
  18.         src/buffer.c, src/charset.c, src/config.h.in, src/configure.in,
  19.         src/diff.c, src/edit.c, src/eval.c, src/ex_cmds2.c,
  20.         src/ex_docmd.c, src/ex_getln.c, src/fileio.c, src/gui_amiga.c
  21.         src/gui_mac.c, src/gui_photon.c, src/gui_w48.c, src/gui_beos.cc,
  22.         src/macros.h, src/main.c, src/mbyte.c, src/menu.c, src/message.c,
  23.         src/misc1.c, src/misc2.c, src/option.c, src/os_msdos.c,
  24.         src/os_mswin.c, src/proto/charset.pro, src/regexp.c, src/option.h,
  25.         src/syntax.c
  26.  
  27.  
  28. *** ../vim61.220/runtime/doc/options.txt    Mon Sep 23 21:32:08 2002
  29. --- runtime/doc/options.txt    Sun Oct 13 19:46:59 2002
  30. ***************
  31. *** 1,4 ****
  32. ! *options.txt*   For Vim version 6.1.  Last change: 2002 Sep 19
  33.   
  34.   
  35.             VIM REFERENCE MANUAL    by Bram Moolenaar
  36. --- 1,4 ----
  37. ! *options.txt*   For Vim version 6.1.  Last change: 2002 Oct 13
  38.   
  39.   
  40.             VIM REFERENCE MANUAL    by Bram Moolenaar
  41. ***************
  42. *** 997,1002 ****
  43. --- 999,1019 ----
  44.               file name.  It is not modified in response to a |:cd|
  45.               command.
  46.   
  47. +                         *'casemap'* *'cmp'*
  48. + 'casemap' 'cmp'        string    (default: "internal,keepascii")
  49. +             global
  50. +             {not in Vi}
  51. +     Specifies details about changing the case of letters  It may contain
  52. +     these words, separated by a comma:
  53. +     internal    Use internal case mapping functions, the current
  54. +             locale does not change the case mapping  This only
  55. +             matters when 'encoding' is a Unicode encoding.  When
  56. +             "internal" is omitted, the towupper() and towlower()
  57. +             system library functions are used when available.
  58. +     keepascii    For the ASCII characters (0x00 to 0x7f) use the US
  59. +             case mapping, the current locale is not effective.
  60. +             This probably only matters for Turkish.
  61.                           *'cdpath'* *'cd'* *E344* *E346*
  62.   'cdpath' 'cd'        string    (default: equivalent to $CDPATH or ",,")
  63.               global
  64. *** ../vim61.220/src/ascii.h    Wed Sep  5 20:31:02 2001
  65. --- src/ascii.h    Sun Oct  6 20:29:01 2002
  66. ***************
  67. *** 41,47 ****
  68.   
  69.   #define POUND        0xA3
  70.   
  71. ! #define Ctrl_chr(x)    (TO_UPPER(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */
  72.   #define Meta(x)        ((x) | 0x80)
  73.   
  74.   #define CTRL_F_STR    "\006"
  75. --- 41,47 ----
  76.   
  77.   #define POUND        0xA3
  78.   
  79. ! #define Ctrl_chr(x)    (TOUPPER_ASC(x) ^ 0x40) /* '?' -> DEL, '@' -> ^@, etc. */
  80.   #define Meta(x)        ((x) | 0x80)
  81.   
  82.   #define CTRL_F_STR    "\006"
  83. *** ../vim61.220/src/auto/configure    Mon Sep 23 21:35:44 2002
  84. --- src/auto/configure    Sun Oct  6 20:55:40 2002
  85. ***************
  86. *** 5868,5882 ****
  87.       memset nanosleep opendir putenv qsort readlink select setenv \
  88.       setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  89.       sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
  90. !     strpbrk strtol tgetent usleep utime utimes
  91.   do
  92.   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  93. ! echo "configure:5830: checking for $ac_func" >&5
  94.   if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  95.     echo $ac_n "(cached) $ac_c" 1>&6
  96.   else
  97.     cat > conftest.$ac_ext <<EOF
  98. ! #line 5835 "configure"
  99.   #include "confdefs.h"
  100.   /* System header to define __stub macros and hopefully few prototypes,
  101.       which can conflict with char $ac_func(); below.  */
  102. --- 5868,5882 ----
  103.       memset nanosleep opendir putenv qsort readlink select setenv \
  104.       setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  105.       sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
  106. !     strpbrk strtol tgetent towlower towupper usleep utime utimes
  107.   do
  108.   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  109. ! echo "configure:5875: checking for $ac_func" >&5
  110.   if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  111.     echo $ac_n "(cached) $ac_c" 1>&6
  112.   else
  113.     cat > conftest.$ac_ext <<EOF
  114. ! #line 5880 "configure"
  115.   #include "confdefs.h"
  116.   /* System header to define __stub macros and hopefully few prototypes,
  117.       which can conflict with char $ac_func(); below.  */
  118. *** ../vim61.220/src/buffer.c    Sun Oct 13 18:48:35 2002
  119. --- src/buffer.c    Sun Oct 13 18:22:22 2002
  120. ***************
  121. *** 3215,3221 ****
  122.           {
  123.           sprintf((char *)tmp, ",%s", wp->w_buffer->b_p_ft);
  124.           for (t = tmp; *t != 0; t++)
  125. !             *t = TO_UPPER(*t);
  126.           str = tmp;
  127.           }
  128.           break;
  129. --- 3215,3221 ----
  130.           {
  131.           sprintf((char *)tmp, ",%s", wp->w_buffer->b_p_ft);
  132.           for (t = tmp; *t != 0; t++)
  133. !             *t = TOUPPER_LOC(*t);
  134.           str = tmp;
  135.           }
  136.           break;
  137. *** ../vim61.220/src/charset.c    Sat Aug  3 14:16:11 2002
  138. --- src/charset.c    Mon Oct  7 21:31:00 2002
  139. ***************
  140. *** 385,420 ****
  141.   
  142.   #if defined(FEAT_SYN_HL) || defined(FEAT_INS_EXPAND) || defined(PROTO)
  143.   /*
  144. !  * Convert the string "p" to do ignore-case comparing.
  145. !  * It's done in-place.
  146.    */
  147. !     void
  148. ! str_foldcase(p)
  149. !     char_u    *p;
  150.   {
  151. !     while (*p != NUL)
  152.       {
  153.   #ifdef FEAT_MBYTE
  154. !     if (has_mbyte && MB_BYTE2LEN(*p) > 1)
  155.       {
  156.           if (enc_utf8)
  157.           {
  158.           int    c, lc;
  159.   
  160. !         c = utf_ptr2char(p);
  161.           lc = utf_tolower(c);
  162. !         if (c != lc && utf_char2len(c) == utf_char2len(lc))
  163. !             (void)utf_char2bytes(c, p);
  164.           }
  165. !         p += (*mb_ptr2len_check)(p);    /* skip multi-byte char */
  166.       }
  167.       else
  168.   #endif
  169.       {
  170. !         *p = TO_LOWER(*p);
  171. !         ++p;
  172.       }
  173.       }
  174.   }
  175.   #endif
  176.   
  177. --- 385,465 ----
  178.   
  179.   #if defined(FEAT_SYN_HL) || defined(FEAT_INS_EXPAND) || defined(PROTO)
  180.   /*
  181. !  * Convert the string "p[len]" to do ignore-case comparing.  Uses the current
  182. !  * locale.  Returns an allocated string (NULL for out-of-memory).
  183.    */
  184. !     char_u *
  185. ! str_foldcase(str, len)
  186. !     char_u    *str;
  187. !     int        len;
  188.   {
  189. !     garray_T    ga;
  190. !     int        i;
  191. ! #define GA_CHAR(i)  ((char_u *)ga.ga_data)[i]
  192. ! #define GA_PTR(i)   ((char_u *)ga.ga_data + i)
  193. !     /* Copy "str" into allocated memory, unmodified. */
  194. !     ga_init2(&ga, 1, 10);
  195. !     if (ga_grow(&ga, len + 1) == FAIL)
  196. !     return NULL;
  197. !     mch_memmove(ga.ga_data, str, len);
  198. !     GA_CHAR(len) = NUL;
  199. !     ga.ga_len = len;
  200. !     ga.ga_room -= len;
  201. !     /* Make each character lower case. */
  202. !     i = 0;
  203. !     while (GA_CHAR(i) != NUL)
  204.       {
  205.   #ifdef FEAT_MBYTE
  206. !     if (enc_utf8 || (has_mbyte && MB_BYTE2LEN(GA_CHAR(i)) > 1))
  207.       {
  208.           if (enc_utf8)
  209.           {
  210.           int    c, lc;
  211.   
  212. !         c = utf_ptr2char(GA_PTR(i));
  213.           lc = utf_tolower(c);
  214. !         if (c != lc)
  215. !         {
  216. !             int        ol = utf_char2len(c);
  217. !             int        nl = utf_char2len(lc);
  218. !             /* If the byte length changes need to shift the following
  219. !              * characters forward or backward. */
  220. !             if (ol != nl)
  221. !             {
  222. !             if (nl > ol)
  223. !                 if (ga_grow(&ga, nl - ol) == FAIL)
  224. !                 {
  225. !                 /* out of memory, keep old char */
  226. !                 lc = c;
  227. !                 nl = ol;
  228. !                 }
  229. !             if (ol != nl)
  230. !             {
  231. !                 mch_memmove(GA_PTR(i) + nl, GA_PTR(i) + ol,
  232. !                           STRLEN(GA_PTR(i) + ol) + 1);
  233. !                 ga.ga_len += nl - ol;
  234. !                 ga.ga_room -= nl - ol;
  235. !             }
  236. !             }
  237. !             (void)utf_char2bytes(lc, GA_PTR(i));
  238. !         }
  239.           }
  240. !         /* skip to next multi-byte char */
  241. !         i += (*mb_ptr2len_check)(GA_PTR(i));
  242.       }
  243.       else
  244.   #endif
  245.       {
  246. !         GA_CHAR(i) = TOLOWER_LOC(GA_CHAR(i));
  247. !         ++i;
  248.       }
  249.       }
  250. +     return (char_u *)ga.ga_data;
  251.   }
  252.   #endif
  253.   
  254. *** ../vim61.220/src/config.h.in    Sun Jul 21 20:30:30 2002
  255. --- src/config.h.in    Sun Oct  6 20:13:55 2002
  256. ***************
  257. *** 186,191 ****
  258. --- 174,181 ----
  259.   #undef HAVE_SYSCTL
  260.   #undef HAVE_SYSINFO
  261.   #undef HAVE_TGETENT
  262. + #undef HAVE_TOWLOWER
  263. + #undef HAVE_TOWUPPER
  264.   #undef HAVE_USLEEP
  265.   #undef HAVE_UTIME
  266.   #undef HAVE_BIND_TEXTDOMAIN_CODESET
  267. *** ../vim61.220/src/configure.in    Mon Sep 23 21:35:44 2002
  268. --- src/configure.in    Sun Oct  6 20:13:08 2002
  269. ***************
  270. *** 1747,1753 ****
  271.       memset nanosleep opendir putenv qsort readlink select setenv \
  272.       setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  273.       sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
  274. !     strpbrk strtol tgetent usleep utime utimes)
  275.   
  276.   dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
  277.   AC_MSG_CHECKING(for st_blksize)
  278. --- 1747,1753 ----
  279.       memset nanosleep opendir putenv qsort readlink select setenv \
  280.       setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
  281.       sigvec strcasecmp strerror strftime stricmp strncasecmp strnicmp \
  282. !     strpbrk strtol tgetent towlower towupper usleep utime utimes)
  283.   
  284.   dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible
  285.   AC_MSG_CHECKING(for st_blksize)
  286. *** ../vim61.220/src/diff.c    Mon Sep 30 19:35:18 2002
  287. --- src/diff.c    Sun Oct  6 20:40:44 2002
  288. ***************
  289. *** 1382,1388 ****
  290.   #endif
  291.           {
  292.           if (*p1 != *p2 && (!(diff_flags & DIFF_ICASE)
  293. !                        || TO_LOWER(*p1) != TO_LOWER(*p2)))
  294.               break;
  295.           ++p1;
  296.           ++p2;
  297. --- 1382,1388 ----
  298.   #endif
  299.           {
  300.           if (*p1 != *p2 && (!(diff_flags & DIFF_ICASE)
  301. !                      || TOLOWER_LOC(*p1) != TOLOWER_LOC(*p2)))
  302.               break;
  303.           ++p1;
  304.           ++p2;
  305. *** ../vim61.220/src/edit.c    Sun Oct 13 16:05:33 2002
  306. --- src/edit.c    Sun Oct 13 15:22:09 2002
  307. ***************
  308. *** 1793,1799 ****
  309.           {
  310.               /* Rule 1 is satisfied */
  311.               for (idx = completion_length; idx < len; ++idx)
  312. !             IObuff[idx] = TO_LOWER(IObuff[idx]);
  313.               break;
  314.           }
  315.           }
  316. --- 1799,1805 ----
  317.           {
  318.               /* Rule 1 is satisfied */
  319.               for (idx = completion_length; idx < len; ++idx)
  320. !             IObuff[idx] = TOLOWER_LOC(IObuff[idx]);
  321.               break;
  322.           }
  323.           }
  324. ***************
  325. *** 1812,1818 ****
  326.           {
  327.               /* Rule 2 is satisfied */
  328.               for (idx = completion_length; idx < len; ++idx)
  329. !             IObuff[idx] = TO_UPPER(IObuff[idx]);
  330.               break;
  331.           }
  332.           was_letter = isalpha(original_text[idx]);
  333. --- 1818,1824 ----
  334.           {
  335.               /* Rule 2 is satisfied */
  336.               for (idx = completion_length; idx < len; ++idx)
  337. !             IObuff[idx] = TOUPPER_LOC(IObuff[idx]);
  338.               break;
  339.           }
  340.           was_letter = isalpha(original_text[idx]);
  341. ***************
  342. *** 3113,3123 ****
  343.               tmp_ptr += ++temp;
  344.               temp = complete_col - temp;
  345.           }
  346. !         complete_pat = vim_strnsave(tmp_ptr, temp);
  347.           if (complete_pat == NULL)
  348.               return FAIL;
  349. -         if (p_ic)
  350. -             str_foldcase(complete_pat);
  351.           }
  352.           else if (continue_status & CONT_ADDING)
  353.           {
  354. --- 3119,3130 ----
  355.               tmp_ptr += ++temp;
  356.               temp = complete_col - temp;
  357.           }
  358. !         if (p_ic)
  359. !             complete_pat = str_foldcase(tmp_ptr, temp);
  360. !         else
  361. !             complete_pat = vim_strnsave(tmp_ptr, temp);
  362.           if (complete_pat == NULL)
  363.               return FAIL;
  364.           }
  365.           else if (continue_status & CONT_ADDING)
  366.           {
  367. ***************
  368. *** 3211,3221 ****
  369.           temp = (int)complete_col - (int)(tmp_ptr - line);
  370.           if (temp < 0)    /* cursor in indent: empty pattern */
  371.           temp = 0;
  372. !         complete_pat = vim_strnsave(tmp_ptr, temp);
  373.           if (complete_pat == NULL)
  374.           return FAIL;
  375. -         if (p_ic)
  376. -         str_foldcase(complete_pat);
  377.       }
  378.       else if (ctrl_x_mode == CTRL_X_FILES)
  379.       {
  380. --- 3218,3229 ----
  381.           temp = (int)complete_col - (int)(tmp_ptr - line);
  382.           if (temp < 0)    /* cursor in indent: empty pattern */
  383.           temp = 0;
  384. !         if (p_ic)
  385. !         complete_pat = str_foldcase(tmp_ptr, temp);
  386. !         else
  387. !         complete_pat = vim_strnsave(tmp_ptr, temp);
  388.           if (complete_pat == NULL)
  389.           return FAIL;
  390.       }
  391.       else if (ctrl_x_mode == CTRL_X_FILES)
  392.       {
  393. ***************
  394. *** 5495,5501 ****
  395.   #endif
  396.               /* TODO: multi-byte */
  397.               if (keytyped == (int)p[-1] || (icase && keytyped < 256
  398. !                    && TO_LOWER(keytyped) == TO_LOWER((int)p[-1])))
  399.           {
  400.               line = ml_get_cursor();
  401.               if ((curwin->w_cursor.col == (colnr_T)(p - look)
  402. --- 5503,5509 ----
  403.   #endif
  404.               /* TODO: multi-byte */
  405.               if (keytyped == (int)p[-1] || (icase && keytyped < 256
  406. !              && TOLOWER_LOC(keytyped) == TOLOWER_LOC((int)p[-1])))
  407.           {
  408.               line = ml_get_cursor();
  409.               if ((curwin->w_cursor.col == (colnr_T)(p - look)
  410. *** ../vim61.220/src/eval.c    Sat Oct 12 21:16:50 2002
  411. --- src/eval.c    Fri Oct 11 19:44:18 2002
  412. ***************
  413. *** 3169,3177 ****
  414.           def = get_var_number(&argvars[2]);
  415.           if (argvars[3].var_type != VAR_UNKNOWN)
  416.           {
  417. !         /* avoid that TO_UPPER calls get_var_string_buf() twice */
  418.           c = *get_var_string_buf(&argvars[3], buf2);
  419. !         switch (TO_UPPER(c))
  420.           {
  421.               case 'E': type = VIM_ERROR; break;
  422.               case 'Q': type = VIM_QUESTION; break;
  423. --- 3169,3177 ----
  424.           def = get_var_number(&argvars[2]);
  425.           if (argvars[3].var_type != VAR_UNKNOWN)
  426.           {
  427. !         /* avoid that TOUPPER_ASC calls get_var_string_buf() twice */
  428.           c = *get_var_string_buf(&argvars[3], buf2);
  429. !         switch (TOUPPER_ASC(c))
  430.           {
  431.               case 'E': type = VIM_ERROR; break;
  432.               case 'Q': type = VIM_QUESTION; break;
  433. ***************
  434. *** 6086,6092 ****
  435.       if (argvars[2].var_type != VAR_UNKNOWN)
  436.       {
  437.       mode = get_var_string_buf(&argvars[2], modebuf);
  438. !     modec = TO_LOWER(mode[0]);
  439.       if (modec != 't' && modec != 'c'
  440.   #ifdef FEAT_GUI
  441.           && modec != 'g'
  442. --- 6086,6092 ----
  443.       if (argvars[2].var_type != VAR_UNKNOWN)
  444.       {
  445.       mode = get_var_string_buf(&argvars[2], modebuf);
  446. !     modec = TOLOWER_ASC(mode[0]);
  447.       if (modec != 't' && modec != 'c'
  448.   #ifdef FEAT_GUI
  449.           && modec != 'g'
  450. ***************
  451. *** 6108,6117 ****
  452.       }
  453.   
  454.   
  455. !     switch (TO_LOWER(what[0]))
  456.       {
  457.       case 'b':
  458. !         if (TO_LOWER(what[1]) == 'g')        /* bg[#] */
  459.               p = highlight_color(id, what, modec);
  460.           else                    /* bold */
  461.               p = highlight_has_attr(id, HL_BOLD, modec);
  462. --- 6108,6117 ----
  463.       }
  464.   
  465.   
  466. !     switch (TOLOWER_ASC(what[0]))
  467.       {
  468.       case 'b':
  469. !         if (TOLOWER_ASC(what[1]) == 'g')    /* bg[#] */
  470.               p = highlight_color(id, what, modec);
  471.           else                    /* bold */
  472.               p = highlight_has_attr(id, HL_BOLD, modec);
  473. ***************
  474. *** 6122,6128 ****
  475.           break;
  476.   
  477.       case 'i':
  478. !         if (TO_LOWER(what[1]) == 'n')        /* inverse */
  479.               p = highlight_has_attr(id, HL_INVERSE, modec);
  480.           else                    /* italic */
  481.               p = highlight_has_attr(id, HL_ITALIC, modec);
  482. --- 6122,6128 ----
  483.           break;
  484.   
  485.       case 'i':
  486. !         if (TOLOWER_ASC(what[1]) == 'n')    /* inverse */
  487.               p = highlight_has_attr(id, HL_INVERSE, modec);
  488.           else                    /* italic */
  489.               p = highlight_has_attr(id, HL_ITALIC, modec);
  490. ***************
  491. *** 6318,6324 ****
  492.           else
  493.   #endif
  494.           {
  495. !         *p = TO_LOWER(*p); /* note that tolower() can be a macro */
  496.           ++p;
  497.           }
  498.       }
  499. --- 6318,6324 ----
  500.           else
  501.   #endif
  502.           {
  503. !         *p = TOLOWER_LOC(*p); /* note that tolower() can be a macro */
  504.           ++p;
  505.           }
  506.       }
  507. ***************
  508. *** 6361,6367 ****
  509.           else
  510.   #endif
  511.           {
  512. !         *p = TO_UPPER(*p); /* note that toupper() can be a macro */
  513.           p++;
  514.           }
  515.       }
  516. --- 6361,6367 ----
  517.           else
  518.   #endif
  519.           {
  520. !         *p = TOUPPER_LOC(*p); /* note that toupper() can be a macro */
  521.           p++;
  522.           }
  523.       }
  524. ***************
  525. *** 8019,8025 ****
  526.   eval_fname_sid(p)
  527.       char_u    *p;
  528.   {
  529. !     return (*p == 's' || TO_UPPER(p[2]) == 'I');
  530.   }
  531.   
  532.   /*
  533. --- 8019,8025 ----
  534.   eval_fname_sid(p)
  535.       char_u    *p;
  536.   {
  537. !     return (*p == 's' || TOUPPER_ASC(p[2]) == 'I');
  538.   }
  539.   
  540.   /*
  541. *** ../vim61.220/src/ex_cmds2.c    Sat Oct 12 17:26:38 2002
  542. --- src/ex_cmds2.c    Sat Oct 12 17:22:00 2002
  543. ***************
  544. *** 2720,2726 ****
  545.   prt_use_number()
  546.   {
  547.       return (printer_opts[OPT_PRINT_NUMBER].present
  548. !         && TO_LOWER(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y');
  549.   }
  550.   
  551.   /*
  552. --- 2720,2726 ----
  553.   prt_use_number()
  554.   {
  555.       return (printer_opts[OPT_PRINT_NUMBER].present
  556. !         && TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y');
  557.   }
  558.   
  559.   /*
  560. ***************
  561. *** 2897,2905 ****
  562.   
  563.   #ifdef FEAT_SYN_HL
  564.       if (printer_opts[OPT_PRINT_SYNTAX].present
  565. !         && TO_LOWER(printer_opts[OPT_PRINT_SYNTAX].string[0]) != 'a')
  566.       settings.do_syntax =
  567. !           (TO_LOWER(printer_opts[OPT_PRINT_SYNTAX].string[0]) == 'y');
  568.       else
  569.       settings.do_syntax = settings.has_color;
  570.   #endif
  571. --- 2897,2905 ----
  572.   
  573.   #ifdef FEAT_SYN_HL
  574.       if (printer_opts[OPT_PRINT_SYNTAX].present
  575. !         && TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) != 'a')
  576.       settings.do_syntax =
  577. !            (TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) == 'y');
  578.       else
  579.       settings.do_syntax = settings.has_color;
  580.   #endif
  581. ***************
  582. *** 2930,2936 ****
  583.   #endif
  584.   
  585.       jobsplit = (printer_opts[OPT_PRINT_JOBSPLIT].present
  586. !           && TO_LOWER(printer_opts[OPT_PRINT_JOBSPLIT].string[0]) == 'y');
  587.   
  588.       if (!mch_print_begin(&settings))
  589.       goto print_fail_no_begin;
  590. --- 2930,2936 ----
  591.   #endif
  592.   
  593.       jobsplit = (printer_opts[OPT_PRINT_JOBSPLIT].present
  594. !        && TOLOWER_ASC(printer_opts[OPT_PRINT_JOBSPLIT].string[0]) == 'y');
  595.   
  596.       if (!mch_print_begin(&settings))
  597.       goto print_fail_no_begin;
  598. ***************
  599. *** 3232,3238 ****
  600.        * line.
  601.        */
  602.       if (line[col] == NUL || (printer_opts[OPT_PRINT_WRAP].present
  603. !           && TO_LOWER(printer_opts[OPT_PRINT_WRAP].string[0]) == 'n'))
  604.       return 0;
  605.       return col;
  606.   }
  607. --- 3232,3238 ----
  608.        * line.
  609.        */
  610.       if (line[col] == NUL || (printer_opts[OPT_PRINT_WRAP].present
  611. !            && TOLOWER_ASC(printer_opts[OPT_PRINT_WRAP].string[0]) == 'n'))
  612.       return 0;
  613.       return col;
  614.   }
  615. ***************
  616. *** 3976,3982 ****
  617.        * Find the size of the paper and set the margins.
  618.        */
  619.       prt_portrait = (!printer_opts[OPT_PRINT_PORTRAIT].present
  620. !           || TO_LOWER(printer_opts[OPT_PRINT_PORTRAIT].string[0]) == 'y');
  621.       if (printer_opts[OPT_PRINT_PAPER].present)
  622.       {
  623.       paper_name = (char *)printer_opts[OPT_PRINT_PAPER].string;
  624. --- 3976,3982 ----
  625.        * Find the size of the paper and set the margins.
  626.        */
  627.       prt_portrait = (!printer_opts[OPT_PRINT_PORTRAIT].present
  628. !        || TOLOWER_ASC(printer_opts[OPT_PRINT_PORTRAIT].string[0]) == 'y');
  629.       if (printer_opts[OPT_PRINT_PAPER].present)
  630.       {
  631.       paper_name = (char *)printer_opts[OPT_PRINT_PAPER].string;
  632. ***************
  633. *** 4055,4061 ****
  634.       psettings->n_uncollated_copies = 1;
  635.       prt_num_copies = 1;
  636.       prt_collate = (!printer_opts[OPT_PRINT_COLLATE].present
  637. !         || TO_LOWER(printer_opts[OPT_PRINT_COLLATE].string[0]) == 'y');
  638.       if (prt_collate)
  639.       {
  640.       /* TODO: Get number of collated copies wanted. */
  641. --- 4055,4061 ----
  642.       psettings->n_uncollated_copies = 1;
  643.       prt_num_copies = 1;
  644.       prt_collate = (!printer_opts[OPT_PRINT_COLLATE].present
  645. !         || TOLOWER_ASC(printer_opts[OPT_PRINT_COLLATE].string[0]) == 'y');
  646.       if (prt_collate)
  647.       {
  648.       /* TODO: Get number of collated copies wanted. */
  649. *** ../vim61.220/src/ex_docmd.c    Fri Oct 11 20:38:35 2002
  650. --- src/ex_docmd.c    Fri Oct 11 20:34:46 2002
  651. ***************
  652. *** 3565,3571 ****
  653.       {
  654.       /* Make 'fileencoding' lower case. */
  655.       for (p = eap->cmd + eap->force_enc; *p != NUL; ++p)
  656. !         *p = TO_LOWER(*p);
  657.       }
  658.   #endif
  659.   
  660. --- 3565,3571 ----
  661.       {
  662.       /* Make 'fileencoding' lower case. */
  663.       for (p = eap->cmd + eap->force_enc; *p != NUL; ++p)
  664. !         *p = TOLOWER_ASC(*p);
  665.       }
  666.   #endif
  667.   
  668. *** ../vim61.220/src/ex_getln.c    Sun Oct 13 16:05:33 2002
  669. --- src/ex_getln.c    Sun Oct 13 15:35:07 2002
  670. ***************
  671. *** 2570,2577 ****
  672.               || xp->xp_context == EXPAND_FILES
  673.               || xp->xp_context == EXPAND_BUFFERS)
  674.           {
  675. !             if (TO_LOWER(cmd_files[i][len]) !=
  676. !                            TO_LOWER(cmd_files[0][len]))
  677.               break;
  678.           }
  679.           else
  680. --- 2570,2577 ----
  681.               || xp->xp_context == EXPAND_FILES
  682.               || xp->xp_context == EXPAND_BUFFERS)
  683.           {
  684. !             if (TOLOWER_LOC(cmd_files[i][len]) !=
  685. !                            TOLOWER_LOC(cmd_files[0][len]))
  686.               break;
  687.           }
  688.           else
  689. *** ../vim61.220/src/fileio.c    Sun Oct 13 18:48:35 2002
  690. --- src/fileio.c    Sun Oct 13 18:42:11 2002
  691. ***************
  692. *** 4494,4500 ****
  693.        * a floppy from "A:\dir" to "B:\dir".
  694.        */
  695.       else if (len > 3
  696. !         && TO_UPPER(full_path[0]) == TO_UPPER(dir_name[0])
  697.           && full_path[1] == ':'
  698.           && vim_ispathsep(full_path[2]))
  699.       p = full_path + 2;
  700. --- 4669,4675 ----
  701.        * a floppy from "A:\dir" to "B:\dir".
  702.        */
  703.       else if (len > 3
  704. !         && TOUPPER_LOC(full_path[0]) == TOUPPER_LOC(dir_name[0])
  705.           && full_path[1] == ':'
  706.           && vim_ispathsep(full_path[2]))
  707.       p = full_path + 2;
  708. *** ../vim61.220/src/gui_amiga.c    Sat May  4 22:23:07 2002
  709. --- src/gui_amiga.c    Sun Oct  6 20:44:33 2002
  710. ***************
  711. *** 142,148 ****
  712.   {
  713.       if (isdigit(c))
  714.       return c - '0';
  715. !     c = TO_LOWER(c);
  716.       if (c >= 'a' && c <= 'f')
  717.       return c - 'a' + 10;
  718.       return -1000;
  719. --- 142,148 ----
  720.   {
  721.       if (isdigit(c))
  722.       return c - '0';
  723. !     c = TOLOWER_ASC(c);
  724.       if (c >= 'a' && c <= 'f')
  725.       return c - 'a' + 10;
  726.       return -1000;
  727. *** ../vim61.220/src/gui_mac.c    Fri Sep 27 19:30:44 2002
  728. --- src/gui_mac.c    Sun Oct  6 20:44:52 2002
  729. ***************
  730. *** 3061,3067 ****
  731.   {
  732.       if (isdigit(c))
  733.       return c - '0';
  734. !     c = TO_LOWER(c);
  735.       if (c >= 'a' && c <= 'f')
  736.       return c - 'a' + 10;
  737.       return -1000;
  738. --- 3061,3067 ----
  739.   {
  740.       if (isdigit(c))
  741.       return c - '0';
  742. !     c = TOLOWER_ASC(c);
  743.       if (c >= 'a' && c <= 'f')
  744.       return c - 'a' + 10;
  745.       return -1000;
  746. *** ../vim61.220/src/gui_photon.c    Sat May  4 22:23:07 2002
  747. --- src/gui_photon.c    Sun Oct  6 20:45:01 2002
  748. ***************
  749. *** 1980,1986 ****
  750.   {
  751.       if (vim_isdigit(c))
  752.       return( c - '0' );
  753. !     c = TO_LOWER(c);
  754.       if (c >= 'a' && c <= 'f')
  755.       return( c - 'a' + 10 );
  756.       return( -1000 );
  757. --- 1980,1986 ----
  758.   {
  759.       if (vim_isdigit(c))
  760.       return( c - '0' );
  761. !     c = TOLOWER_ASC(c);
  762.       if (c >= 'a' && c <= 'f')
  763.       return( c - 'a' + 10 );
  764.       return( -1000 );
  765. *** ../vim61.220/src/gui_w48.c    Mon Sep 16 22:00:32 2002
  766. --- src/gui_w48.c    Tue Oct  8 20:55:33 2002
  767. ***************
  768. *** 1146,1152 ****
  769.   {
  770.       if (vim_isdigit(c))
  771.       return c - '0';
  772. !     c = TO_LOWER(c);
  773.       if (c >= 'a' && c <= 'f')
  774.       return c - 'a' + 10;
  775.       return -1000;
  776. --- 1146,1152 ----
  777.   {
  778.       if (vim_isdigit(c))
  779.       return c - '0';
  780. !     c = TOLOWER_ASC(c);
  781.       if (c >= 'a' && c <= 'f')
  782.       return c - 'a' + 10;
  783.       return -1000;
  784. *** ../vim61.220/src/gui_beos.cc    Sat May  4 22:23:07 2002
  785. --- src/gui_beos.cc    Sun Oct  6 20:53:33 2002
  786. ***************
  787. *** 2455,2461 ****
  788.   {
  789.       if (isdigit(c))
  790.       return c - '0';
  791. !     c = TO_LOWER(c);
  792.       if (c >= 'a' && c <= 'f')
  793.       return c - 'a' + 10;
  794.       return -1000;
  795. --- 2455,2461 ----
  796.   {
  797.       if (isdigit(c))
  798.       return c - '0';
  799. !     c = TOLOWER_ASC(c);
  800.       if (c >= 'a' && c <= 'f')
  801.       return c - 'a' + 10;
  802.       return -1000;
  803. *** ../vim61.220/src/macros.h    Sun Jul 21 20:30:31 2002
  804. --- src/macros.h    Sun Oct  6 21:52:17 2002
  805. ***************
  806. *** 51,74 ****
  807.   #define bufempty() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == NUL)
  808.   
  809.   /*
  810.    * On some systems toupper()/tolower() only work on lower/uppercase characters
  811. !  * Careful: Only call TO_UPPER() and TO_LOWER() with a character in the range
  812. !  * 0 - 255.  toupper()/tolower() on some systems can't handle others.
  813.    * Note: for UTF-8 use utf_toupper() and utf_tolower().
  814.    */
  815.   #ifdef MSWIN
  816. ! #  define TO_UPPER(c)    toupper_tab[(c) & 255]
  817. ! #  define TO_LOWER(c)    tolower_tab[(c) & 255]
  818.   #else
  819.   # ifdef BROKEN_TOUPPER
  820. ! #  define TO_UPPER(c)    (islower(c) ? toupper(c) : (c))
  821. ! #  define TO_LOWER(c)    (isupper(c) ? tolower(c) : (c))
  822.   # else
  823. ! #  define TO_UPPER    toupper
  824. ! #  define TO_LOWER    tolower
  825.   # endif
  826.   #endif
  827.   
  828.   /*
  829.    * MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters.  But
  830.    * don't use them for negative values or values above 0x100 for DBCS.
  831. --- 51,84 ----
  832.   #define bufempty() (curbuf->b_ml.ml_line_count == 1 && *ml_get((linenr_T)1) == NUL)
  833.   
  834.   /*
  835. +  * toupper() and tolower() that use the current locale.
  836.    * On some systems toupper()/tolower() only work on lower/uppercase characters
  837. !  * Careful: Only call TOUPPER_LOC() and TOLOWER_LOC() with a character in the
  838. !  * range 0 - 255.  toupper()/tolower() on some systems can't handle others.
  839.    * Note: for UTF-8 use utf_toupper() and utf_tolower().
  840.    */
  841.   #ifdef MSWIN
  842. ! #  define TOUPPER_LOC(c)    toupper_tab[(c) & 255]
  843. ! #  define TOLOWER_LOC(c)    tolower_tab[(c) & 255]
  844.   #else
  845.   # ifdef BROKEN_TOUPPER
  846. ! #  define TOUPPER_LOC(c)    (islower(c) ? toupper(c) : (c))
  847. ! #  define TOLOWER_LOC(c)    (isupper(c) ? tolower(c) : (c))
  848.   # else
  849. ! #  define TOUPPER_LOC        toupper
  850. ! #  define TOLOWER_LOC        tolower
  851.   # endif
  852.   #endif
  853.   
  854. + /* toupper() and tolower() for ASCII only and ignore the current locale. */
  855. + #ifdef EBCDIC
  856. + # define TOUPPER_ASC(c)    (islower(c) ? toupper(c) : (c))
  857. + # define TOLOWER_ASC(c)    (isupper(c) ? tolower(c) : (c))
  858. + #else
  859. + # define TOUPPER_ASC(c)    (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A'))
  860. + # define TOLOWER_ASC(c)    (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A'))
  861. + #endif
  862.   /*
  863.    * MB_ISLOWER() and MB_ISUPPER() are to be used on multi-byte characters.  But
  864.    * don't use them for negative values or values above 0x100 for DBCS.
  865. ***************
  866. *** 76,88 ****
  867.   #ifdef FEAT_MBYTE
  868.   # define MB_ISLOWER(c)    (enc_utf8 && (c) > 0x80 ? utf_islower(c) : islower(c))
  869.   # define MB_ISUPPER(c)    (enc_utf8 && (c) > 0x80 ? utf_isupper(c) : isupper(c))
  870. ! # define MB_TOLOWER(c)    (enc_utf8 && (c) > 0x80 ? utf_tolower(c) : TO_LOWER(c))
  871. ! # define MB_TOUPPER(c)    (enc_utf8 && (c) > 0x80 ? utf_toupper(c) : TO_UPPER(c))
  872.   #else
  873.   # define MB_ISLOWER(c)    islower(c)
  874.   # define MB_ISUPPER(c)    isupper(c)
  875. ! # define MB_TOLOWER(c)    TO_LOWER(c)
  876. ! # define MB_TOUPPER(c)    TO_UPPER(c)
  877.   #endif
  878.   
  879.   /* Like isalpha() but reject non-ASCII characters.  Can't be used with a
  880. --- 86,98 ----
  881.   #ifdef FEAT_MBYTE
  882.   # define MB_ISLOWER(c)    (enc_utf8 && (c) > 0x80 ? utf_islower(c) : islower(c))
  883.   # define MB_ISUPPER(c)    (enc_utf8 && (c) > 0x80 ? utf_isupper(c) : isupper(c))
  884. ! # define MB_TOLOWER(c)    (enc_utf8 && (c) > 0x80 ? utf_tolower(c) : TOLOWER_LOC(c))
  885. ! # define MB_TOUPPER(c)    (enc_utf8 && (c) > 0x80 ? utf_toupper(c) : TOUPPER_LOC(c))
  886.   #else
  887.   # define MB_ISLOWER(c)    islower(c)
  888.   # define MB_ISUPPER(c)    isupper(c)
  889. ! # define MB_TOLOWER(c)    TOLOWER_LOC(c)
  890. ! # define MB_TOUPPER(c)    TOUPPER_LOC(c)
  891.   #endif
  892.   
  893.   /* Like isalpha() but reject non-ASCII characters.  Can't be used with a
  894. *** ../vim61.220/src/main.c    Mon Sep 23 21:12:18 2002
  895. --- src/main.c    Sun Oct  6 20:45:54 2002
  896. ***************
  897. *** 411,425 ****
  898.       /* TODO: On MacOS X default to gui if argv[0] ends in:
  899.        *       /vim.app/Contents/MacOS/Vim */
  900.   
  901. !     if (TO_LOWER(initstr[0]) == 'r')
  902.       {
  903.       restricted = TRUE;
  904.       ++initstr;
  905.       }
  906.   
  907.       /* Avoid using evim mode for "editor". */
  908. !     if (TO_LOWER(initstr[0]) == 'e'
  909. !         && (TO_LOWER(initstr[1]) == 'v' || TO_LOWER(initstr[1]) == 'g'))
  910.       {
  911.   #ifdef FEAT_GUI
  912.       gui.starting = TRUE;
  913. --- 411,426 ----
  914.       /* TODO: On MacOS X default to gui if argv[0] ends in:
  915.        *       /vim.app/Contents/MacOS/Vim */
  916.   
  917. !     if (TOLOWER_ASC(initstr[0]) == 'r')
  918.       {
  919.       restricted = TRUE;
  920.       ++initstr;
  921.       }
  922.   
  923.       /* Avoid using evim mode for "editor". */
  924. !     if (TOLOWER_ASC(initstr[0]) == 'e'
  925. !         && (TOLOWER_ASC(initstr[1]) == 'v'
  926. !                        || TOLOWER_ASC(initstr[1]) == 'g'))
  927.       {
  928.   #ifdef FEAT_GUI
  929.       gui.starting = TRUE;
  930. ***************
  931. *** 428,434 ****
  932.       ++initstr;
  933.       }
  934.   
  935. !     if (TO_LOWER(initstr[0]) == 'g')
  936.       {
  937.       main_start_gui();
  938.   #ifdef FEAT_GUI
  939. --- 429,435 ----
  940.       ++initstr;
  941.       }
  942.   
  943. !     if (TOLOWER_ASC(initstr[0]) == 'g')
  944.       {
  945.       main_start_gui();
  946.   #ifdef FEAT_GUI
  947. ***************
  948. *** 506,515 ****
  949.           if (c == '/')
  950.           {
  951.           c = argv[0][argv_idx++];
  952. !         c = TO_UPPER(c);
  953.           }
  954.           else
  955. !         c = TO_LOWER(c);
  956.   #endif
  957.           switch (c)
  958.           {
  959. --- 507,516 ----
  960.           if (c == '/')
  961.           {
  962.           c = argv[0][argv_idx++];
  963. !         c = TOUPPER_ASC(c);
  964.           }
  965.           else
  966. !         c = TOLOWER_ASC(c);
  967.   #endif
  968.           switch (c)
  969.           {
  970. ***************
  971. *** 2688,2694 ****
  972.           /* Guess that when the server name starts with "g" it's a GUI
  973.            * server, which we can bring to the foreground here.
  974.            * Foreground() in the server doesn't work very well. */
  975. !         if (argtype != ARGTYPE_SEND && TO_UPPER(*sname) == 'G')
  976.               SetForegroundWindow(srv);
  977.   # endif
  978.   
  979. --- 2689,2695 ----
  980.           /* Guess that when the server name starts with "g" it's a GUI
  981.            * server, which we can bring to the foreground here.
  982.            * Foreground() in the server doesn't work very well. */
  983. !         if (argtype != ARGTYPE_SEND && TOUPPER_ASC(*sname) == 'G')
  984.               SetForegroundWindow(srv);
  985.   # endif
  986.   
  987. *** ../vim61.220/src/mbyte.c    Sat Oct 12 15:48:03 2002
  988. --- src/mbyte.c    Sat Oct 12 15:33:10 2002
  989. ***************
  990. *** 1771,1778 ****
  991.   utf_toupper(a)
  992.       int        a;
  993.   {
  994.       if (a < 128)
  995. !     return toupper(a);
  996.       return utf_convert(a, toUpper, sizeof(toUpper));
  997.   }
  998.   
  999. --- 1771,1791 ----
  1000.   utf_toupper(a)
  1001.       int        a;
  1002.   {
  1003. +     /* If 'casemap' contains "keepascii" use ASCII style toupper(). */
  1004. +     if (a < 128 && (cmp_flags & CMP_KEEPASCII))
  1005. +     return TOUPPER_ASC(a);
  1006. + #if defined(HAVE_TOWUPPER) && defined(__STDC__ISO_10646__)
  1007. +     /* If towupper() is availble and handles Unicode, use it. */
  1008. +     if (!(cmp_flags & CMP_INTERNAL))
  1009. +     return towupper(a);
  1010. + #endif
  1011. +     /* For characters below 128 use locale sensitive toupper(). */
  1012.       if (a < 128)
  1013. !     return TOUPPER_LOC(a);
  1014. !     /* For any other characters use the above mapping table. */
  1015.       return utf_convert(a, toUpper, sizeof(toUpper));
  1016.   }
  1017.   
  1018. ***************
  1019. *** 1791,1798 ****
  1020.   utf_tolower(a)
  1021.       int        a;
  1022.   {
  1023.       if (a < 128)
  1024. !     return tolower(a);
  1025.       return utf_convert(a, toLower, sizeof(toLower));
  1026.   }
  1027.   
  1028. --- 1804,1824 ----
  1029.   utf_tolower(a)
  1030.       int        a;
  1031.   {
  1032. +     /* If 'casemap' contains "keepascii" use ASCII style tolower(). */
  1033. +     if (a < 128 && (cmp_flags & CMP_KEEPASCII))
  1034. +     return TOLOWER_ASC(a);
  1035. + #if defined(HAVE_TOWLOWER) && defined(__STDC__ISO_10646__)
  1036. +     /* If towlower() is availble and handles Unicode, use it. */
  1037. +     if (!(cmp_flags & CMP_INTERNAL))
  1038. +     return towlower(a);
  1039. + #endif
  1040. +     /* For characters below 128 use locale sensitive tolower(). */
  1041.       if (a < 128)
  1042. !     return TOLOWER_LOC(a);
  1043. !     /* For any other characters use the above mapping table. */
  1044.       return utf_convert(a, toLower, sizeof(toLower));
  1045.   }
  1046.   
  1047. ***************
  1048. *** 1830,1836 ****
  1049.           /* Single byte: first check normally, then with ignore case. */
  1050.           if (s1[i] != s2[i])
  1051.           {
  1052. !         cdiff = TO_LOWER(s1[i]) - TO_LOWER(s2[i]);
  1053.           if (cdiff != 0)
  1054.               return cdiff;
  1055.           }
  1056. --- 1856,1862 ----
  1057.           /* Single byte: first check normally, then with ignore case. */
  1058.           if (s1[i] != s2[i])
  1059.           {
  1060. !         cdiff = TOLOWER_LOC(s1[i]) - TOLOWER_LOC(s2[i]);
  1061.           if (cdiff != 0)
  1062.               return cdiff;
  1063.           }
  1064. ***************
  1065. *** 2319,2325 ****
  1066.           if (*s == '_')
  1067.           *p++ = '-';
  1068.           else
  1069. !         *p++ = TO_LOWER(*s);
  1070.       }
  1071.       *p = NUL;
  1072.   
  1073. --- 2345,2351 ----
  1074.           if (*s == '_')
  1075.           *p++ = '-';
  1076.           else
  1077. !         *p++ = TOLOWER_ASC(*s);
  1078.       }
  1079.       *p = NUL;
  1080.   
  1081. ***************
  1082. *** 2445,2451 ****
  1083.       if (s[i] == '_' || s[i] == '-')
  1084.           buf[i] = '-';
  1085.       else if (isalnum((int)s[i]))
  1086. !         buf[i] = TO_LOWER(s[i]);
  1087.       else
  1088.           break;
  1089.       }
  1090. --- 2471,2477 ----
  1091.       if (s[i] == '_' || s[i] == '-')
  1092.           buf[i] = '-';
  1093.       else if (isalnum((int)s[i]))
  1094. !         buf[i] = TOLOWER_ASC(s[i]);
  1095.       else
  1096.           break;
  1097.       }
  1098. *** ../vim61.220/src/menu.c    Mon Feb 11 15:31:34 2002
  1099. --- src/menu.c    Sun Oct 13 15:43:15 2002
  1100. ***************
  1101. *** 1824,1833 ****
  1102.       vimmenu_T    *menu;
  1103.   
  1104.       if (key < 256)
  1105. !     key = TO_LOWER(key);
  1106.       for (menu = root_menu; menu != NULL; menu = menu->next)
  1107.       if (menu->mnemonic == key
  1108. !         || (menu->mnemonic < 256 && TO_LOWER(menu->mnemonic) == key))
  1109.           return TRUE;
  1110.       return FALSE;
  1111.   }
  1112. --- 1833,1842 ----
  1113.       vimmenu_T    *menu;
  1114.   
  1115.       if (key < 256)
  1116. !     key = TOLOWER_LOC(key);
  1117.       for (menu = root_menu; menu != NULL; menu = menu->next)
  1118.       if (menu->mnemonic == key
  1119. !         || (menu->mnemonic < 256 && TOLOWER_LOC(menu->mnemonic) == key))
  1120.           return TRUE;
  1121.       return FALSE;
  1122.   }
  1123. *** ../vim61.220/src/message.c    Mon Sep 16 22:00:32 2002
  1124. --- src/message.c    Sun Oct  6 20:47:55 2002
  1125. ***************
  1126. *** 2294,2300 ****
  1127.               continue;
  1128.           for (retval = 0; hotkeys[retval]; retval++)
  1129.           {
  1130. !             if (hotkeys[retval] == TO_LOWER(c))
  1131.               break;
  1132.           }
  1133.           if (hotkeys[retval])
  1134. --- 2294,2300 ----
  1135.               continue;
  1136.           for (retval = 0; hotkeys[retval]; retval++)
  1137.           {
  1138. !             if (hotkeys[retval] == TOLOWER_LOC(c))
  1139.               break;
  1140.           }
  1141.           if (hotkeys[retval])
  1142. ***************
  1143. *** 2386,2392 ****
  1144.       p = confirm_msg + 1 + STRLEN(message);
  1145.       q = hotk;
  1146.       r = buttons;
  1147. !     *q = (char_u)TO_LOWER(*r);    /* define lowercase hotkey */
  1148.   
  1149.       /* Remember where the choices start, displaying starts here when "q" typed
  1150.        * at the more prompt. */
  1151. --- 2386,2392 ----
  1152.       p = confirm_msg + 1 + STRLEN(message);
  1153.       q = hotk;
  1154.       r = buttons;
  1155. !     *q = (char_u)TOLOWER_LOC(*r);    /* define lowercase hotkey */
  1156.   
  1157.       /* Remember where the choices start, displaying starts here when "q" typed
  1158.        * at the more prompt. */
  1159. ***************
  1160. *** 2399,2405 ****
  1161.       {
  1162.           *p++ = ',';
  1163.           *p++ = ' ';        /* '\n' -> ', ' */
  1164. !         *(++q) = (char_u)TO_LOWER(*(r + 1)); /* next hotkey */
  1165.           if (dfltbutton)
  1166.           --dfltbutton;
  1167.       }
  1168. --- 2399,2405 ----
  1169.       {
  1170.           *p++ = ',';
  1171.           *p++ = ' ';        /* '\n' -> ', ' */
  1172. !         *(++q) = (char_u)TOLOWER_LOC(*(r + 1)); /* next hotkey */
  1173.           if (dfltbutton)
  1174.           --dfltbutton;
  1175.       }
  1176. ***************
  1177. *** 2414,2420 ****
  1178.           *p++ = (dfltbutton == 1) ? '[' : '(';
  1179.           *p++ = *r;
  1180.           *p++ = (dfltbutton == 1) ? ']' : ')';
  1181. !         *q = (char_u)TO_LOWER(*r);    /* define lowercase hotkey */
  1182.           }
  1183.       }
  1184.       else
  1185. --- 2414,2420 ----
  1186.           *p++ = (dfltbutton == 1) ? '[' : '(';
  1187.           *p++ = *r;
  1188.           *p++ = (dfltbutton == 1) ? ']' : ')';
  1189. !         *q = (char_u)TOLOWER_LOC(*r);    /* define lowercase hotkey */
  1190.           }
  1191.       }
  1192.       else
  1193. *** ../vim61.220/src/misc1.c    Mon Sep 16 22:00:32 2002
  1194. --- src/misc1.c    Sun Oct  6 20:48:36 2002
  1195. ***************
  1196. *** 2925,2931 ****
  1197.                   ))
  1198.               {
  1199.   #ifdef OS2        /* env vars only in uppercase */
  1200. !             *var++ = TO_UPPER(*tail);
  1201.               tail++;        /* toupper() may be a macro! */
  1202.   #else
  1203.               *var++ = *tail++;
  1204. --- 2925,2931 ----
  1205.                   ))
  1206.               {
  1207.   #ifdef OS2        /* env vars only in uppercase */
  1208. !             *var++ = TOUPPER_LOC(*tail);
  1209.               tail++;        /* toupper() may be a macro! */
  1210.   #else
  1211.               *var++ = *tail++;
  1212. ***************
  1213. *** 3789,3795 ****
  1214.   {
  1215.       while (len > 0 && *x && *y)
  1216.       {
  1217. !     if (TO_LOWER(*x) != TO_LOWER(*y)
  1218.           && !(*x == '/' && *y == '\\')
  1219.           && !(*x == '\\' && *y == '/'))
  1220.           break;
  1221. --- 3789,3795 ----
  1222.   {
  1223.       while (len > 0 && *x && *y)
  1224.       {
  1225. !     if (TOLOWER_LOC(*x) != TOLOWER_LOC(*y)
  1226.           && !(*x == '/' && *y == '\\')
  1227.           && !(*x == '\\' && *y == '/'))
  1228.           break;
  1229. ***************
  1230. *** 6553,6559 ****
  1231.       else
  1232.   #  endif
  1233.       while (*s)
  1234. !         *d++ = TO_LOWER(*s++);
  1235.       *d = NUL;
  1236.   }
  1237.   # endif
  1238. --- 6553,6559 ----
  1239.       else
  1240.   #  endif
  1241.       while (*s)
  1242. !         *d++ = TOLOWER_LOC(*s++);
  1243.       *d = NUL;
  1244.   }
  1245.   # endif
  1246. *** ../vim61.220/src/misc2.c    Mon Sep 30 22:29:09 2002
  1247. --- src/misc2.c    Sun Oct  6 20:50:36 2002
  1248. ***************
  1249. *** 1281,1287 ****
  1250.   
  1251.   #if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
  1252.   /*
  1253. !  * Compare two strings, ignoring case.
  1254.    * return 0 for match, < 0 for smaller, > 0 for bigger
  1255.    */
  1256.       int
  1257. --- 1281,1288 ----
  1258.   
  1259.   #if (!defined(HAVE_STRCASECMP) && !defined(HAVE_STRICMP)) || defined(PROTO)
  1260.   /*
  1261. !  * Compare two strings, ignoring case, using current locale.
  1262. !  * Doesn't work for multi-byte characters.
  1263.    * return 0 for match, < 0 for smaller, > 0 for bigger
  1264.    */
  1265.       int
  1266. ***************
  1267. *** 1293,1299 ****
  1268.   
  1269.       for (;;)
  1270.       {
  1271. !     i = (int)TO_LOWER(*s1) - (int)TO_LOWER(*s2);
  1272.       if (i != 0)
  1273.           return i;                /* this character different */
  1274.       if (*s1 == NUL)
  1275. --- 1294,1300 ----
  1276.   
  1277.       for (;;)
  1278.       {
  1279. !     i = (int)TOLOWER_LOC(*s1) - (int)TOLOWER_LOC(*s2);
  1280.       if (i != 0)
  1281.           return i;                /* this character different */
  1282.       if (*s1 == NUL)
  1283. ***************
  1284. *** 1307,1313 ****
  1285.   
  1286.   #if (!defined(HAVE_STRNCASECMP) && !defined(HAVE_STRNICMP)) || defined(PROTO)
  1287.   /*
  1288. !  * Compare two strings, for length "len", ignoring case.
  1289.    * return 0 for match, < 0 for smaller, > 0 for bigger
  1290.    */
  1291.       int
  1292. --- 1308,1315 ----
  1293.   
  1294.   #if (!defined(HAVE_STRNCASECMP) && !defined(HAVE_STRNICMP)) || defined(PROTO)
  1295.   /*
  1296. !  * Compare two strings, for length "len", ignoring case, using current locale.
  1297. !  * Doesn't work for multi-byte characters.
  1298.    * return 0 for match, < 0 for smaller, > 0 for bigger
  1299.    */
  1300.       int
  1301. ***************
  1302. *** 1320,1326 ****
  1303.   
  1304.       while (len > 0)
  1305.       {
  1306. !     i = (int)TO_LOWER(*s1) - (int)TO_LOWER(*s2);
  1307.       if (i != 0)
  1308.           return i;                /* this character different */
  1309.       if (*s1 == NUL)
  1310. --- 1322,1328 ----
  1311.   
  1312.       while (len > 0)
  1313.       {
  1314. !     i = (int)TOLOWER_LOC(*s1) - (int)TOLOWER_LOC(*s2);
  1315.       if (i != 0)
  1316.           return i;                /* this character different */
  1317.       if (*s1 == NUL)
  1318. ***************
  1319. *** 1934,1946 ****
  1320.   {
  1321.       int        i;
  1322.   
  1323. !     if (c > 0 && c <= 255)    /* avoid TO_UPPER() with number > 255 */
  1324. !     {
  1325. !     c = TO_UPPER(c);
  1326. !     for (i = 0; mod_mask_table[i].mod_mask != 0; i++)
  1327. !         if (c == mod_mask_table[i].name)
  1328. !         return mod_mask_table[i].mod_flag;
  1329. !     }
  1330.       return 0;
  1331.   }
  1332.   
  1333. --- 1936,1945 ----
  1334.   {
  1335.       int        i;
  1336.   
  1337. !     c = TOUPPER_ASC(c);
  1338. !     for (i = 0; mod_mask_table[i].mod_mask != 0; i++)
  1339. !     if (c == mod_mask_table[i].name)
  1340. !         return mod_mask_table[i].mod_flag;
  1341.       return 0;
  1342.   }
  1343.   
  1344. ***************
  1345. *** 2288,2294 ****
  1346.   #endif
  1347.       if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key))
  1348.       {
  1349. !     key = TO_UPPER(key);
  1350.       modifiers &= ~MOD_MASK_SHIFT;
  1351.       }
  1352.       if ((modifiers & MOD_MASK_CTRL)
  1353. --- 2287,2293 ----
  1354.   #endif
  1355.       if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key))
  1356.       {
  1357. !     key = TOUPPER_ASC(key);
  1358.       modifiers &= ~MOD_MASK_SHIFT;
  1359.       }
  1360.       if ((modifiers & MOD_MASK_CTRL)
  1361. ***************
  1362. *** 2372,2378 ****
  1363.       {
  1364.           table_name = key_names_table[i].name;
  1365.           for (j = 0; vim_isIDc(name[j]) && table_name[j] != NUL; j++)
  1366. !         if (TO_LOWER(table_name[j]) != TO_LOWER(name[j]))
  1367.               break;
  1368.           if (!vim_isIDc(name[j]) && table_name[j] == NUL)
  1369.           return key_names_table[i].key;
  1370. --- 2371,2377 ----
  1371.       {
  1372.           table_name = key_names_table[i].name;
  1373.           for (j = 0; vim_isIDc(name[j]) && table_name[j] != NUL; j++)
  1374. !         if (TOLOWER_ASC(table_name[j]) != TOLOWER_ASC(name[j]))
  1375.               break;
  1376.           if (!vim_isIDc(name[j]) && table_name[j] == NUL)
  1377.           return key_names_table[i].key;
  1378. ***************
  1379. *** 2796,2802 ****
  1380.               len = 1;
  1381.               else
  1382.               len = 2;
  1383. !             if (len == 1 && TO_LOWER(modep[0]) == 'a')
  1384.               all_idx = SHAPE_IDX_COUNT - 1;
  1385.               else
  1386.               {
  1387. --- 2795,2801 ----
  1388.               len = 1;
  1389.               else
  1390.               len = 2;
  1391. !             if (len == 1 && TOLOWER_ASC(modep[0]) == 'a')
  1392.               all_idx = SHAPE_IDX_COUNT - 1;
  1393.               else
  1394.               {
  1395. ***************
  1396. *** 2893,2899 ****
  1397.                       return (char_u *)N_("Illegal percentage");
  1398.                   if (round == 2)
  1399.                   {
  1400. !                     if (TO_LOWER(i) == 'v')
  1401.                       shape_table[idx].shape = SHAPE_VER;
  1402.                       else
  1403.                       shape_table[idx].shape = SHAPE_HOR;
  1404. --- 2892,2898 ----
  1405.                       return (char_u *)N_("Illegal percentage");
  1406.                   if (round == 2)
  1407.                   {
  1408. !                     if (TOLOWER_ASC(i) == 'v')
  1409.                       shape_table[idx].shape = SHAPE_VER;
  1410.                       else
  1411.                       shape_table[idx].shape = SHAPE_HOR;
  1412. ***************
  1413. *** 4466,4472 ****
  1414.       {
  1415.       if (s1[i] != s2[i]
  1416.   #ifdef CASE_INSENSITIVE_FILENAME
  1417. !         && TO_UPPER(s1[i]) != TO_UPPER(s2[i])
  1418.   #endif
  1419.           )
  1420.       {
  1421. --- 4465,4471 ----
  1422.       {
  1423.       if (s1[i] != s2[i]
  1424.   #ifdef CASE_INSENSITIVE_FILENAME
  1425. !         && TOUPPER_LOC(s1[i]) != TOUPPER_LOC(s2[i])
  1426.   #endif
  1427.           )
  1428.       {
  1429. ***************
  1430. *** 5217,5223 ****
  1431.   
  1432.       if (
  1433.   #ifdef CASE_INSENSITIVE_FILENAME
  1434. !         TO_UPPER(p[i]) != TO_UPPER(q[i])
  1435.   #else
  1436.           p[i] != q[i]
  1437.   #endif
  1438. --- 5216,5222 ----
  1439.   
  1440.       if (
  1441.   #ifdef CASE_INSENSITIVE_FILENAME
  1442. !         TOUPPER_LOC(p[i]) != TOUPPER_LOC(q[i])
  1443.   #else
  1444.           p[i] != q[i]
  1445.   #endif
  1446. *** ../vim61.220/src/option.c    Mon Sep 23 21:32:08 2002
  1447. --- src/option.c    Sun Oct  6 20:50:46 2002
  1448. ***************
  1449. *** 455,460 ****
  1450. --- 455,464 ----
  1451.                   {(char_u *)0L, (char_u *)0L}
  1452.   #endif
  1453.                   },
  1454. +     {"casemap",        "cmp",   P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
  1455. +                 (char_u *)&p_cmp, PV_NONE,
  1456. +                 {(char_u *)"internal,keepascii", (char_u *)0L}
  1457. +                 },
  1458.       {"cdpath",        "cd",   P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
  1459.   #ifdef FEAT_SEARCHPATH
  1460.                   (char_u *)&p_cdpath, PV_NONE,
  1461. ***************
  1462. *** 3407,3413 ****
  1463.                   i = 1;
  1464.   #ifdef HAVE_STRTOL
  1465.                   value = strtol((char *)arg, NULL, 0);
  1466. !                 if (arg[i] == '0' && TO_LOWER(arg[i + 1]) == 'x')
  1467.                   i += 2;
  1468.   #else
  1469.                   value = atol((char *)arg);
  1470. --- 3413,3419 ----
  1471.                   i = 1;
  1472.   #ifdef HAVE_STRTOL
  1473.                   value = strtol((char *)arg, NULL, 0);
  1474. !                 if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
  1475.                   i += 2;
  1476.   #else
  1477.                   value = atol((char *)arg);
  1478. ***************
  1479. *** 4031,4036 ****
  1480. --- 4037,4043 ----
  1481.       /* initialize the table for 'iskeyword' et.al. */
  1482.       (void)init_chartab();
  1483.   
  1484. +     (void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE);
  1485.   #ifdef FEAT_SESSION
  1486.       (void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE);
  1487.       (void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE);
  1488. ***************
  1489. *** 5162,5167 ****
  1490. --- 5169,5181 ----
  1491.           errmsg = e_invarg;
  1492.       }
  1493.       else if (check_opt_strings(p_bs, p_bs_values, TRUE) != OK)
  1494. +         errmsg = e_invarg;
  1495. +     }
  1496. +     /* 'casemap' */
  1497. +     else if (varp == &p_cmp)
  1498. +     {
  1499. +     if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE) != OK)
  1500.           errmsg = e_invarg;
  1501.       }
  1502.   
  1503. *** ../vim61.220/src/os_msdos.c    Sun Aug 18 15:48:20 2002
  1504. --- src/os_msdos.c    Sun Oct  6 20:51:08 2002
  1505. ***************
  1506. *** 2241,2247 ****
  1507.       return 0;
  1508.       if (path[1] == ':')            /* has a drive name */
  1509.       {
  1510. !     if (change_drive(TO_LOWER(path[0]) - 'a' + 1))
  1511.           return -1;            /* invalid drive name */
  1512.       path += 2;
  1513.       }
  1514. --- 2241,2247 ----
  1515.       return 0;
  1516.       if (path[1] == ':')            /* has a drive name */
  1517.       {
  1518. !     if (change_drive(TOLOWER_ASC(path[0]) - 'a' + 1))
  1519.           return -1;            /* invalid drive name */
  1520.       path += 2;
  1521.       }
  1522. *** ../vim61.220/src/os_mswin.c    Mon Mar 11 21:46:49 2002
  1523. --- src/os_mswin.c    Sun Oct  6 20:51:28 2002
  1524. ***************
  1525. *** 576,582 ****
  1526.       /* If we can change to the drive, skip that part of the path.  If we
  1527.        * can't then the current directory may be invalid, try using chdir()
  1528.        * with the whole path. */
  1529. !     if (_chdrive(TO_LOWER(path[0]) - 'a' + 1) == 0)
  1530.           path += 2;
  1531.       }
  1532.   
  1533. --- 576,582 ----
  1534.       /* If we can change to the drive, skip that part of the path.  If we
  1535.        * can't then the current directory may be invalid, try using chdir()
  1536.        * with the whole path. */
  1537. !     if (_chdrive(TOLOWER_ASC(path[0]) - 'a' + 1) == 0)
  1538.           path += 2;
  1539.       }
  1540.   
  1541. *** ../vim61.220/src/proto/charset.pro    Fri Mar 22 21:41:06 2002
  1542. --- src/proto/charset.pro    Sun Oct  6 21:57:38 2002
  1543. ***************
  1544. *** 3,9 ****
  1545.   int buf_init_chartab __ARGS((buf_T *buf, int global));
  1546.   void trans_characters __ARGS((char_u *buf, int bufsize));
  1547.   char_u *transstr __ARGS((char_u *s));
  1548. ! void str_foldcase __ARGS((char_u *p));
  1549.   char_u *transchar __ARGS((int c));
  1550.   char_u *transchar_byte __ARGS((int c));
  1551.   void transchar_nonprint __ARGS((char_u *buf, int c));
  1552. --- 3,9 ----
  1553.   int buf_init_chartab __ARGS((buf_T *buf, int global));
  1554.   void trans_characters __ARGS((char_u *buf, int bufsize));
  1555.   char_u *transstr __ARGS((char_u *s));
  1556. ! char_u *str_foldcase __ARGS((char_u *str, int len));
  1557.   char_u *transchar __ARGS((int c));
  1558.   char_u *transchar_byte __ARGS((int c));
  1559.   void transchar_nonprint __ARGS((char_u *buf, int c));
  1560. *** ../vim61.220/src/regexp.c    Mon Sep 30 22:22:34 2002
  1561. --- src/regexp.c    Sun Oct  6 20:52:05 2002
  1562. ***************
  1563. *** 2845,2851 ****
  1564.               (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
  1565.               || (c < 255 && prog->regstart < 255 &&
  1566.   #endif
  1567. !                 TO_LOWER(prog->regstart) == TO_LOWER(c)))))
  1568.           retval = regtry(prog, col);
  1569.       else
  1570.           retval = 0;
  1571. --- 2847,2853 ----
  1572.               (enc_utf8 && utf_fold(prog->regstart) == utf_fold(c)))
  1573.               || (c < 255 && prog->regstart < 255 &&
  1574.   #endif
  1575. !                 TOLOWER_LOC(prog->regstart) == TOLOWER_LOC(c)))))
  1576.           retval = regtry(prog, col);
  1577.       else
  1578.           retval = 0;
  1579. ***************
  1580. *** 3432,3438 ****
  1581.   #ifdef FEAT_MBYTE
  1582.                   !enc_utf8 &&
  1583.   #endif
  1584. !                 TO_LOWER(*opnd) != TO_LOWER(*reginput))))
  1585.               return FALSE;
  1586.           if (*opnd == NUL)
  1587.           {
  1588. --- 3434,3440 ----
  1589.   #ifdef FEAT_MBYTE
  1590.                   !enc_utf8 &&
  1591.   #endif
  1592. !                 TOLOWER_LOC(*opnd) != TOLOWER_LOC(*reginput))))
  1593.               return FALSE;
  1594.           if (*opnd == NUL)
  1595.           {
  1596. ***************
  1597. *** 3886,3894 ****
  1598.               if (ireg_ic)
  1599.               {
  1600.               if (isupper(nextb))
  1601. !                 nextb_ic = TO_LOWER(nextb);
  1602.               else
  1603. !                 nextb_ic = TO_UPPER(nextb);
  1604.               }
  1605.               else
  1606.               nextb_ic = nextb;
  1607. --- 3888,3896 ----
  1608.               if (ireg_ic)
  1609.               {
  1610.               if (isupper(nextb))
  1611. !                 nextb_ic = TOLOWER_LOC(nextb);
  1612.               else
  1613. !                 nextb_ic = TOUPPER_LOC(nextb);
  1614.               }
  1615.               else
  1616.               nextb_ic = nextb;
  1617. ***************
  1618. *** 4407,4414 ****
  1619.            * would have been used for it. */
  1620.           if (ireg_ic)
  1621.           {
  1622. !         cu = TO_UPPER(*opnd);
  1623. !         cl = TO_LOWER(*opnd);
  1624.           while (count < maxcount && (*scan == cu || *scan == cl))
  1625.           {
  1626.               count++;
  1627. --- 4409,4416 ----
  1628.            * would have been used for it. */
  1629.           if (ireg_ic)
  1630.           {
  1631. !         cu = TOUPPER_LOC(*opnd);
  1632. !         cl = TOLOWER_LOC(*opnd);
  1633.           while (count < maxcount && (*scan == cu || *scan == cl))
  1634.           {
  1635.               count++;
  1636. ***************
  1637. *** 5206,5214 ****
  1638.       else
  1639.   #endif
  1640.        if (isupper(c))
  1641. !     cc = TO_LOWER(c);
  1642.       else if (islower(c))
  1643. !     cc = TO_UPPER(c);
  1644.       else
  1645.       return vim_strchr(s, c);
  1646.   
  1647. --- 5208,5216 ----
  1648.       else
  1649.   #endif
  1650.        if (isupper(c))
  1651. !     cc = TOLOWER_LOC(c);
  1652.       else if (islower(c))
  1653. !     cc = TOUPPER_LOC(c);
  1654.       else
  1655.       return vim_strchr(s, c);
  1656.   
  1657. ***************
  1658. *** 5266,5272 ****
  1659.       char_u *d;
  1660.       int c;
  1661.   {
  1662. !     *d = TO_UPPER(c);
  1663.   
  1664.       return (fptr)NULL;
  1665.   }
  1666. --- 5268,5274 ----
  1667.       char_u *d;
  1668.       int c;
  1669.   {
  1670. !     *d = TOUPPER_LOC(c);
  1671.   
  1672.       return (fptr)NULL;
  1673.   }
  1674. ***************
  1675. *** 5276,5282 ****
  1676.       char_u *d;
  1677.       int c;
  1678.   {
  1679. !     *d = TO_UPPER(c);
  1680.   
  1681.       return (fptr)do_Upper;
  1682.   }
  1683. --- 5278,5284 ----
  1684.       char_u *d;
  1685.       int c;
  1686.   {
  1687. !     *d = TOUPPER_LOC(c);
  1688.   
  1689.       return (fptr)do_Upper;
  1690.   }
  1691. ***************
  1692. *** 5286,5292 ****
  1693.       char_u *d;
  1694.       int c;
  1695.   {
  1696. !     *d = TO_LOWER(c);
  1697.   
  1698.       return (fptr)NULL;
  1699.   }
  1700. --- 5288,5294 ----
  1701.       char_u *d;
  1702.       int c;
  1703.   {
  1704. !     *d = TOLOWER_LOC(c);
  1705.   
  1706.       return (fptr)NULL;
  1707.   }
  1708. ***************
  1709. *** 5296,5302 ****
  1710.       char_u    *d;
  1711.       int        c;
  1712.   {
  1713. !     *d = TO_LOWER(c);
  1714.   
  1715.       return (fptr)do_Lower;
  1716.   }
  1717. --- 5298,5304 ----
  1718.       char_u    *d;
  1719.       int        c;
  1720.   {
  1721. !     *d = TOLOWER_LOC(c);
  1722.   
  1723.       return (fptr)do_Lower;
  1724.   }
  1725. *** ../vim61.220/src/option.h    Sun Jul 28 22:02:42 2002
  1726. --- src/option.h    Sun Oct  6 20:57:57 2002
  1727. ***************
  1728. *** 309,314 ****
  1729. --- 309,321 ----
  1730.   #ifdef FEAT_LINEBREAK
  1731.   EXTERN char_u    *p_breakat;    /* 'breakat' */
  1732.   #endif
  1733. + EXTERN char_u    *p_cmp;        /* 'casemap' */
  1734. + EXTERN unsigned    cmp_flags;
  1735. + #ifdef IN_OPTION_C
  1736. + static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
  1737. + #endif
  1738. + #define CMP_INTERNAL        0x001
  1739. + #define CMP_KEEPASCII        0x002
  1740.   #ifdef FEAT_MBYTE
  1741.   EXTERN char_u    *p_enc;        /* 'encoding' */
  1742.   EXTERN int    p_deco;        /* 'delcombine' */
  1743. *** ../vim61.220/src/syntax.c    Sat Sep 28 15:15:20 2002
  1744. --- src/syntax.c    Sun Oct  6 21:54:54 2002
  1745. ***************
  1746. *** 2946,2952 ****
  1747.           ktab = syn_buf->b_keywtab[syn_khash(keyword)];
  1748.       else /* round == 2, ignore case */
  1749.       {
  1750. !         str_foldcase(keyword);
  1751.           ktab = syn_buf->b_keywtab_ic[syn_khash(keyword)];
  1752.       }
  1753.   
  1754. --- 2948,2960 ----
  1755.           ktab = syn_buf->b_keywtab[syn_khash(keyword)];
  1756.       else /* round == 2, ignore case */
  1757.       {
  1758. !         p = str_foldcase(keyword, STRLEN(keyword));
  1759. !         if (p != NULL)
  1760. !         {
  1761. !         STRNCPY(keyword, p, MAXKEYWLEN);
  1762. !         keyword[MAXKEYWLEN] = NUL;
  1763. !         vim_free(p);
  1764. !         }
  1765.           ktab = syn_buf->b_keywtab_ic[syn_khash(keyword)];
  1766.       }
  1767.   
  1768. ***************
  1769. *** 3904,3914 ****
  1770.       keyentry_T    *ktab;
  1771.       keyentry_T    ***ktabpp;
  1772.       int        hash;
  1773.   
  1774. !     ktab = (keyentry_T *)alloc((int)(sizeof(keyentry_T) + STRLEN(name)));
  1775.       if (ktab == NULL)
  1776.       return;
  1777. !     STRCPY(ktab->keyword, name);
  1778.       ktab->k_syn.id = id;
  1779.       ktab->k_syn.inc_tag = current_syn_inc_tag;
  1780.       ktab->flags = flags;
  1781. --- 3912,3931 ----
  1782.       keyentry_T    *ktab;
  1783.       keyentry_T    ***ktabpp;
  1784.       int        hash;
  1785. +     char_u    *name_ic = name;
  1786.   
  1787. !     if (curbuf->b_syn_ic)
  1788. !     {
  1789. !     name_ic = str_foldcase(name, STRLEN(name));
  1790. !     if (name_ic == NULL)
  1791. !         name_ic = name;
  1792. !     }
  1793. !     ktab = (keyentry_T *)alloc((int)(sizeof(keyentry_T) + STRLEN(name_ic)));
  1794.       if (ktab == NULL)
  1795.       return;
  1796. !     STRCPY(ktab->keyword, name_ic);
  1797. !     if (name_ic != name)
  1798. !     vim_free(name_ic);
  1799.       ktab->k_syn.id = id;
  1800.       ktab->k_syn.inc_tag = current_syn_inc_tag;
  1801.       ktab->flags = flags;
  1802. ***************
  1803. *** 3918,3927 ****
  1804.       ktab->next_list = copy_id_list(next_list);
  1805.   
  1806.       if (curbuf->b_syn_ic)
  1807. -     {
  1808. -     str_foldcase(ktab->keyword);
  1809.       ktabpp = &curbuf->b_keywtab_ic;
  1810. -     }
  1811.       else
  1812.       ktabpp = &curbuf->b_keywtab;
  1813.   
  1814. --- 3935,3941 ----
  1815. ***************
  1816. *** 4047,4053 ****
  1817.       {
  1818.           if (!isalpha(arg[llen]))
  1819.           break;
  1820. !         lowname[llen] = TO_LOWER(arg[llen]);
  1821.       }
  1822.   
  1823.       for (fidx = sizeof(flagtab) / sizeof(struct flag); --fidx >= 0; )
  1824. --- 4061,4067 ----
  1825.       {
  1826.           if (!isalpha(arg[llen]))
  1827.           break;
  1828. !         lowname[llen] = TOLOWER_ASC(arg[llen]);
  1829.       }
  1830.   
  1831.       for (fidx = sizeof(flagtab) / sizeof(struct flag); --fidx >= 0; )
  1832. ***************
  1833. *** 5383,5389 ****
  1834.               || STRCMP(name + 1, "TOP") == 0
  1835.               || STRCMP(name + 1, "CONTAINED") == 0)
  1836.           {
  1837. !         if (TO_UPPER(**arg) != 'C')
  1838.           {
  1839.               EMSG2(_("E407: %s not allowed here"), name + 1);
  1840.               failed = TRUE;
  1841. --- 5397,5403 ----
  1842.               || STRCMP(name + 1, "TOP") == 0
  1843.               || STRCMP(name + 1, "CONTAINED") == 0)
  1844.           {
  1845. !         if (TOUPPER_ASC(**arg) != 'C')
  1846.           {
  1847.               EMSG2(_("E407: %s not allowed here"), name + 1);
  1848.               failed = TRUE;
  1849. ***************
  1850. *** 6533,6539 ****
  1851.   #endif
  1852.   
  1853.           /* reduce calls to STRICMP a bit, it can be slow */
  1854. !         off = TO_UPPER(*arg);
  1855.           for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; )
  1856.               if (off == color_names[i][0]
  1857.                    && STRICMP(arg + 1, color_names[i] + 1) == 0)
  1858. --- 6547,6553 ----
  1859.   #endif
  1860.   
  1861.           /* reduce calls to STRICMP a bit, it can be slow */
  1862. !         off = TOUPPER_ASC(*arg);
  1863.           for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; )
  1864.               if (off == color_names[i][0]
  1865.                    && STRICMP(arg + 1, color_names[i] + 1) == 0)
  1866. ***************
  1867. *** 7557,7563 ****
  1868.       if (id <= 0 || id > highlight_ga.ga_len)
  1869.       return NULL;
  1870.   
  1871. !     if (TO_LOWER(what[0]) == 'f')
  1872.       fg = TRUE;
  1873.       else
  1874.       fg = FALSE;
  1875. --- 7571,7577 ----
  1876.       if (id <= 0 || id > highlight_ga.ga_len)
  1877.       return NULL;
  1878.   
  1879. !     if (TOLOWER_ASC(what[0]) == 'f')
  1880.       fg = TRUE;
  1881.       else
  1882.       fg = FALSE;
  1883. *** ../vim61.220/src/version.c    Sun Oct 13 18:48:35 2002
  1884. --- src/version.c    Sun Oct 13 19:50:11 2002
  1885. ***************
  1886. *** 608,609 ****
  1887. --- 608,611 ----
  1888.   {   /* Add new patch number below this line */
  1889. + /**/
  1890. +     221,
  1891.   /**/
  1892.  
  1893. -- 
  1894. hundred-and-one symptoms of being an internet addict:
  1895. 212. Your Internet group window has more icons than your Accessories window.
  1896.  
  1897.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  1898. ///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
  1899. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  1900.  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
  1901.