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.3 / 6.3.027 < prev    next >
Encoding:
Internet Message Format  |  2004-09-17  |  7.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.3.027
  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.3.027
  11. Problem:    VMS: Writing a file may insert extra CR characters.  Not all
  12.         terminals are recognized correctly.  Vt320 doesn't support colors.
  13.         Environment variables are not expanded correctly.
  14. Solution:   Use another method to write files.  Add vt320 termcap codes for
  15.         colors.  (Zoltan Arpadffy)
  16. Files:        src/fileio.c, src/misc1.c, src/os_unix.c, src/structs.h,
  17.         src/term.c
  18.  
  19.  
  20. *** ../vim-6.3.026/src/fileio.c    Sat Sep  4 16:05:51 2004
  21. --- src/fileio.c    Sat Sep  4 15:55:15 2004
  22. ***************
  23. *** 479,484 ****
  24. --- 479,486 ----
  25.   #endif
  26.   #ifdef VMS
  27.           curbuf->b_fab_rfm = st.st_fab_rfm;
  28. +         curbuf->b_fab_rat = st.st_fab_rat;
  29. +         curbuf->b_fab_mrs = st.st_fab_mrs;
  30.   #endif
  31.       }
  32.       else
  33. ***************
  34. *** 2543,2548 ****
  35. --- 2545,2555 ----
  36.   }
  37.   #endif /* UNIX */
  38.   
  39. + #if defined(VMS) && !defined(MIN)
  40. + /* Older DECC compiler for VAX doesn't define MIN() */
  41. + # define MIN(a, b) ((a) < (b) ? (a) : (b))
  42. + #endif
  43.   /*
  44.    * buf_write() - write to file 'fname' lines 'start' through 'end'
  45.    *
  46. ***************
  47. *** 3936,3955 ****
  48.        * On VMS there is a problem: newlines get added when writing blocks
  49.        * at a time. Fix it by writing a line at a time.
  50.        * This is much slower!
  51. !      * Explanation: Vim can not handle, so far, variable record format.
  52. !      * With $analize/rms filename you can get the rms file structure, and
  53. !      * if the Record format filed is variable, CR will be added after
  54. !      * every written buffer.  In other cases it works without this fix.
  55. !      * From other side read is about 5 times slower for "variable record
  56. !      * format" files.
  57.        */
  58. !     if (buf->b_fab_rfm == FAB$C_VAR)
  59.       {
  60. !         write_info.bw_len = len;
  61. !         if (buf_write_bytes(&write_info) == FAIL)
  62.           {
  63. !         end = 0;        /* write error: break loop */
  64. !         break;
  65.           }
  66.           write_info.bw_len = bufsize;
  67.           nchars += len;
  68. --- 3943,3971 ----
  69.        * On VMS there is a problem: newlines get added when writing blocks
  70.        * at a time. Fix it by writing a line at a time.
  71.        * This is much slower!
  72. !      * Explanation: VAX/DECC RTL insists that records in some RMS
  73. !      * structures end with a newline (carriage return) character, and if
  74. !      * they don't it adds one.
  75. !      * With other RMS structures it works perfect without this fix.
  76.        */
  77. !     if ((buf->b_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0)
  78.       {
  79. !         int b2write;
  80. !         buf->b_fab_mrs = (buf->b_fab_mrs == 0
  81. !             ? MIN(4096, bufsize)
  82. !             : MIN(buf->b_fab_mrs, bufsize));
  83. !         b2write = len;
  84. !         while (b2write > 0)
  85.           {
  86. !         write_info.bw_len = MIN(b2write, buf->b_fab_mrs);
  87. !         if (buf_write_bytes(&write_info) == FAIL)
  88. !         {
  89. !             end = 0;
  90. !             break;
  91. !         }
  92. !         b2write -= MIN(b2write, buf->b_fab_mrs);
  93.           }
  94.           write_info.bw_len = bufsize;
  95.           nchars += len;
  96. *** ../vim-6.3.026/src/misc1.c    Tue Aug 31 20:06:01 2004
  97. --- src/misc1.c    Tue Aug 31 20:02:22 2004
  98. ***************
  99. *** 3233,3239 ****
  100.       while (*src && dstlen > 0)
  101.       {
  102.       copy_char = TRUE;
  103. !     if (*src == '$'
  104.   #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
  105.           || *src == '%'
  106.   #endif
  107. --- 3233,3243 ----
  108.       while (*src && dstlen > 0)
  109.       {
  110.       copy_char = TRUE;
  111. !     if ((*src == '$'
  112. ! #ifdef VMS
  113. !             && at_start
  114. ! #endif
  115. !        )
  116.   #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
  117.           || *src == '%'
  118.   #endif
  119. *** ../vim-6.3.026/src/os_unix.c    Wed Jun  9 14:56:26 2004
  120. --- src/os_unix.c    Mon Aug 30 12:07:11 2004
  121. ***************
  122. *** 1921,1929 ****
  123.   {
  124.       if (name == NULL)
  125.       return FALSE;           /* actually all ANSI comp. terminals should be here  */
  126. !     return (STRNICMP(name, "vt3", 3) == 0     /* it will cover all from VT100-VT300 */
  127. !         || STRNICMP(name, "vt2", 3) == 0  /* TODO: from VT340 can hanle colors  */
  128. !         || STRNICMP(name, "vt1", 3) == 0
  129.           || STRCMP(name, "builtin_vt320") == 0);
  130.   }
  131.   
  132. --- 1921,1929 ----
  133.   {
  134.       if (name == NULL)
  135.       return FALSE;           /* actually all ANSI comp. terminals should be here  */
  136. !     /* catch VT100 - VT5xx */
  137. !     return ((STRNICMP(name, "vt", 2) == 0
  138. !         && vim_strchr((char_u *)"12345", name[2]) != NULL)
  139.           || STRCMP(name, "builtin_vt320") == 0);
  140.   }
  141.   
  142. *** ../vim-6.3.026/src/structs.h    Wed Jun  9 14:56:26 2004
  143. --- src/structs.h    Mon Aug 30 12:09:57 2004
  144. ***************
  145. *** 918,924 ****
  146.       FSSpec    b_FSSpec;    /* MacOS File Identification */
  147.   #endif
  148.   #ifdef VMS
  149. !     char    b_fab_rfm;    /* Record format */
  150.   #endif
  151.   #ifdef FEAT_SNIFF
  152.       int        b_sniff;    /* file was loaded through Sniff */
  153. --- 918,926 ----
  154.       FSSpec    b_FSSpec;    /* MacOS File Identification */
  155.   #endif
  156.   #ifdef VMS
  157. !     char     b_fab_rfm;    /* Record format    */
  158. !     char     b_fab_rat;    /* Record attribute */
  159. !     unsigned int b_fab_mrs;    /* Max record size  */
  160.   #endif
  161.   #ifdef FEAT_SNIFF
  162.       int        b_sniff;    /* file was loaded through Sniff */
  163. *** ../vim-6.3.026/src/term.c    Wed Jun  9 14:56:26 2004
  164. --- src/term.c    Mon Aug 30 12:02:37 2004
  165. ***************
  166. *** 808,815 ****
  167. --- 808,827 ----
  168.       {(int)KS_CDL,    IF_EB("\033[%dM", ESC_STR "[%dM")},
  169.   #  endif
  170.       {(int)KS_CL,    IF_EB("\033[H\033[2J", ESC_STR "[H" ESC_STR_nc "[2J")},
  171. +     {(int)KS_CD,    IF_EB("\033[J", ESC_STR "[J")},
  172. +     {(int)KS_CCO,    "8"},            /* allow 8 colors */
  173.       {(int)KS_ME,    IF_EB("\033[0m", ESC_STR "[0m")},
  174.       {(int)KS_MR,    IF_EB("\033[7m", ESC_STR "[7m")},
  175. +     {(int)KS_MD,        IF_EB("\033[1m", ESC_STR "[1m")},  /* bold mode */
  176. +     {(int)KS_SE,        IF_EB("\033[22m", ESC_STR "[22m")},/* normal mode */
  177. +     {(int)KS_UE,        IF_EB("\033[24m", ESC_STR "[24m")},/* exit underscore mode */
  178. +     {(int)KS_US,        IF_EB("\033[4m", ESC_STR "[4m")},  /* underscore mode */
  179. +     {(int)KS_CZH,       IF_EB("\033[34;43m", ESC_STR "[34;43m" )},  /* italic mode: blue text on yellow */
  180. +     {(int)KS_CZR,       IF_EB("\033[0m", ESC_STR "[0m")},           /* italic mode end */
  181. +     {(int)KS_CAB,       IF_EB("\033[4%dm", ESC_STR "[4%dm" )},      /* set background color (ANSI) */
  182. +     {(int)KS_CAF,       IF_EB("\033[3%dm", ESC_STR "[3%dm" )},      /* set foreground color (ANSI) */
  183. +     {(int)KS_CSB,       IF_EB("\033[102;%dm", ESC_STR "[102;%dm" )},    /* set screen background color */
  184. +     {(int)KS_CSF,       IF_EB("\033[101;%dm", ESC_STR "[101;%dm" )},    /* set screen foreground color */
  185.       {(int)KS_MS,    "y"},
  186.       {(int)KS_UT,    "y"},
  187.       {(int)KS_LE,    "\b"},
  188. *** ../vim-6.3.026/src/version.c    Mon Sep 13 16:36:12 2004
  189. --- src/version.c    Sat Sep 18 20:25:07 2004
  190. ***************
  191. *** 643,644 ****
  192. --- 643,646 ----
  193.   {   /* Add new patch number below this line */
  194. + /**/
  195. +     27,
  196.   /**/
  197.  
  198. -- 
  199. Scientists decoded the first message from an alien civilization:
  200.         SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR
  201. SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT
  202. YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER
  203. STAR SYSTEMS.  WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE
  204. ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS
  205. MAXIMUM!  IT REALLY WORKS!
  206.  
  207.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  208. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  209. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  210.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  211.