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