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.0.041 < prev    next >
Encoding:
Internet Message Format  |  2001-10-29  |  3.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.041
  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.0.041
  11. Problem:    Using ":language messages en" when LC_MESSAGES is undefined
  12.         results in setting LC_CTYPE. (Eric Carlier)
  13. Solution:   Set $LC_MESSAGES instead.
  14. Files:        src/ex_cmds2.c
  15.  
  16.  
  17. *** ../vim60.40/src/ex_cmds2.c    Sun Oct 28 21:23:45 2001
  18. --- src/ex_cmds2.c    Tue Oct 30 20:32:04 2001
  19. ***************
  20. *** 4628,4633 ****
  21. --- 4628,4638 ----
  22.       char_u    *name;
  23.       int        what = LC_ALL;
  24.       char    *whatstr = "";
  25. + #ifdef LC_MESSAGES
  26. + # define VIM_LC_MESSAGES LC_MESSAGES
  27. + #else
  28. + # define VIM_LC_MESSAGES 6789
  29. + #endif
  30.   
  31.       name = eap->arg;
  32.   
  33. ***************
  34. *** 4639,4649 ****
  35.       {
  36.       if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0)
  37.       {
  38. ! #ifdef LC_MESSAGES
  39. !         what = LC_MESSAGES;
  40. ! #else
  41. !         what = LC_CTYPE;
  42. ! #endif
  43.           name = skipwhite(p);
  44.           whatstr = "messages ";
  45.       }
  46. --- 4644,4650 ----
  47.       {
  48.       if (STRNICMP(eap->arg, "messages", p - eap->arg) == 0)
  49.       {
  50. !         what = VIM_LC_MESSAGES;
  51.           name = skipwhite(p);
  52.           whatstr = "messages ";
  53.       }
  54. ***************
  55. *** 4663,4674 ****
  56.   
  57.       if (*name == NUL)
  58.       {
  59. !     smsg((char_u *)_("Current %slanguage: \"%s\""),
  60. !         whatstr, setlocale(what, NULL));
  61.       }
  62.       else
  63.       {
  64. !     loc = setlocale(what, (char *)name);
  65.       if (loc == NULL)
  66.           EMSG2(_("E197: Cannot set language to \"%s\""), name);
  67.       else
  68. --- 4664,4695 ----
  69.   
  70.       if (*name == NUL)
  71.       {
  72. ! #ifndef LC_MESSAGES
  73. !     if (what == VIM_LC_MESSAGES)
  74. !     {
  75. !         p = vim_getenv("LC_ALL");
  76. !         if (p == NULL || *p == NUL)
  77. !         {
  78. !         p = vim_getenv("LC_MESSAGES");
  79. !         if (p == NULL || *p == NUL)
  80. !             p = vim_getenv("LANG");
  81. !         }
  82. !     }
  83. !     else
  84. ! #endif
  85. !         p = setlocale(what, NULL);
  86. !     if (p == NULL || *p == NUL)
  87. !         p = "Unknown";
  88. !     smsg((char_u *)_("Current %slanguage: \"%s\""), whatstr, p);
  89.       }
  90.       else
  91.       {
  92. ! #ifndef LC_MESSAGES
  93. !     if (what == VIM_LC_MESSAGES)
  94. !         loc = "";
  95. !     else
  96. ! #endif
  97. !         loc = setlocale(what, (char *)name);
  98.       if (loc == NULL)
  99.           EMSG2(_("E197: Cannot set language to \"%s\""), name);
  100.       else
  101. ***************
  102. *** 4697,4705 ****
  103.           /* Set $LC_CTYPE, because it overrules $LANG, and
  104.            * gtk_set_locale() calls setlocale() again.  gnome_init()
  105.            * sets $LC_CTYPE to "en_US" (that's a bug!). */
  106. ! #ifdef LC_MESSAGES
  107. !         if (what != LC_MESSAGES)
  108. ! #endif
  109.               vim_setenv((char_u *)"LC_CTYPE", name);
  110.   # ifdef FEAT_GUI_GTK
  111.           /* Let GTK know what locale we're using.  Not sure this is
  112. --- 4718,4724 ----
  113.           /* Set $LC_CTYPE, because it overrules $LANG, and
  114.            * gtk_set_locale() calls setlocale() again.  gnome_init()
  115.            * sets $LC_CTYPE to "en_US" (that's a bug!). */
  116. !         if (what != VIM_LC_MESSAGES)
  117.               vim_setenv((char_u *)"LC_CTYPE", name);
  118.   # ifdef FEAT_GUI_GTK
  119.           /* Let GTK know what locale we're using.  Not sure this is
  120. *** ../vim60.40/src/version.c    Tue Oct 30 20:35:08 2001
  121. --- src/version.c    Tue Oct 30 20:34:45 2001
  122. ***************
  123. *** 608,609 ****
  124. --- 608,611 ----
  125.   {   /* Add new patch number below this line */
  126. + /**/
  127. +     41,
  128.   /**/
  129.  
  130. -- 
  131. BEDEVERE: Look!  It's the old man from scene 24 - what's he Doing here?
  132. ARTHUR:   He is the keeper of the Bridge.  He asks each traveler five
  133.           questions ...
  134. GALAHAD:  Three questions.
  135.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  136.  
  137.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  138. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  139.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  140.