]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.408
- remove missing .po files
[packages/vim.git] / 6.2.408
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.408
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.2.408
11 Problem:    ":compiler" is not consistent: Sets local options and a global
12             variable. (Douglas Potts)  There is no error message when a
13             compiler is not supported.
14 Solution:   Use ":compiler!" to set a compiler globally, otherwise it's local
15             to the buffer and "b:current_compiler" is used.  Give an error
16             when no compiler script could be found.
17             Note: updated compiler plugins can be found at
18             ftp://ftp.vim.org/pub/vim/runtime/compiler/
19 Files:      runtime/compiler/msvc.vim, runtime/doc/quickfix.txt, src/eval.c,
20             src/ex_cmds2.c
21
22
23 *** ../vim-6.2.407/runtime/compiler/msvc.vim    Mon Sep 24 19:58:35 2001
24 --- runtime/compiler/msvc.vim   Fri Mar 19 20:48:09 2004
25 ***************
26 *** 1,13 ****
27   " Vim compiler file
28   " Compiler:   Miscrosoft Visual C
29   " Maintainer: Bram Moolenaar <Bram@vim.org>
30 ! " Last Change:        2001 Sep 24
31   
32   if exists("current_compiler")
33     finish
34   endif
35   let current_compiler = "msvc"
36   
37   " The errorformat for MSVC is the default.
38 ! setlocal errorformat&
39 ! setlocal makeprg=nmake
40 --- 1,17 ----
41   " Vim compiler file
42   " Compiler:   Miscrosoft Visual C
43   " Maintainer: Bram Moolenaar <Bram@vim.org>
44 ! " Last Change:        2004 Mar 19
45   
46   if exists("current_compiler")
47     finish
48   endif
49   let current_compiler = "msvc"
50   
51 + if exists(":CompilerSet") != 2                " older Vim always used :setlocal
52 +   command -nargs=* CompilerSet setlocal <args>
53 + endif
54
55   " The errorformat for MSVC is the default.
56 ! CompilerSet errorformat&
57 ! CompilerSet makeprg=nmake
58 *** ../vim-6.2.407/runtime/doc/quickfix.txt     Tue Feb 10 19:35:15 2004
59 --- runtime/doc/quickfix.txt    Sat Mar 27 12:57:25 2004
60 ***************
61 *** 1,4 ****
62 ! *quickfix.txt*  For Vim version 6.2.  Last change: 2004 Feb 10
63   
64   
65                   VIM REFERENCE MANUAL    by Bram Moolenaar
66 --- 1,4 ----
67 ! *quickfix.txt*  For Vim version 6.2.  Last change: 2004 Mar 27
68   
69   
70                   VIM REFERENCE MANUAL    by Bram Moolenaar
71 ***************
72 *** 365,379 ****
73   =============================================================================
74   6. Selecting a compiler                                       *compiler-select*
75   
76 !                                                       *:comp* *:compiler*
77 ! :comp[iler] {name}            Set options to work with compiler {name}.
78                                 {not available when compiled without the
79                                 |+eval| feature}
80   
81   
82 ! What this command actually does is:
83 ! - delete the "current_compiler" variable              *current_compiler*
84 ! - execute ":runtime! compiler/{name}.vim"
85   
86   For writing a compiler plugin, see |write-compiler-plugin|.
87   
88 --- 365,399 ----
89   =============================================================================
90   6. Selecting a compiler                                       *compiler-select*
91   
92 !                                               *:comp* *:compiler* *E666*
93 ! :comp[iler][!] {name}         Set options to work with compiler {name}.
94 !                               Without the "!" options are set for the
95 !                               current buffer.  With "!" global options are
96 !                               set.
97 !                               If you use ":compiler foo" in "file.foo" and
98 !                               then ":compiler! bar" in another buffer, Vim
99 !                               will keep on using "foo" in "file.foo".
100                                 {not available when compiled without the
101                                 |+eval| feature}
102   
103   
104 ! The Vim plugins in the "compiler" directory will set options to use the
105 ! selected compiler.  For ":compiler" local options are set, for ":compiler!"
106 ! global options.
107 !                                                       *current_compiler*
108 ! To support older Vim versions, the plugins always use "current_compiler" and
109 ! not "b:current_compiler".  What the command actually does is the following:
110
111 ! - Delete the "current_compiler" and "b:current_compiler" variables.
112 ! - Define the "CompilerSet" user command.  With "!" it does ":set", without "!"
113 !   it does ":setlocal".
114 ! - Execute ":runtime! compiler/{name}.vim".  The plugins are expected to set
115 !   options with "CompilerSet" and set the "current_compiler" variable to the
116 !   name of the compiler.
117 ! - Delete the "CompilerSet user command.
118 ! - Set "b:current_compiler" to the value of "current_compiler".
119 ! - Without "!" the old value of "current_compiler" is restored.
120
121   
122   For writing a compiler plugin, see |write-compiler-plugin|.
123   
124 *** ../vim-6.2.407/src/eval.c   Wed Mar 17 14:08:56 2004
125 --- src/eval.c  Fri Mar 26 12:05:28 2004
126 ***************
127 *** 418,424 ****
128   static char_u * make_expanded_name __ARGS((char_u *in_start,  char_u *expr_start,  char_u *expr_end,  char_u *in_end));
129   #endif
130   
131 - #if defined(FEAT_STL_OPT) || defined(PROTO)
132   /*
133    * Set an internal variable to a string value. Creates the variable if it does
134    * not already exist.
135 --- 418,423 ----
136 ***************
137 *** 442,448 ****
138         }
139       }
140   }
141 - #endif
142   
143   # if defined(FEAT_MBYTE) || defined(PROTO)
144       int
145 --- 441,446 ----
146 *** ../vim-6.2.407/src/ex_cmds2.c       Sun Mar  7 19:33:55 2004
147 --- src/ex_cmds2.c      Sat Mar 27 13:02:59 2004
148 ***************
149 *** 1756,1783 ****
150   
151   #ifdef FEAT_EVAL
152   /*
153 !  * ":compiler {name}"
154    */
155       void
156   ex_compiler(eap)
157       exarg_T   *eap;
158   {
159       char_u    *buf;
160   
161       if (*eap->arg == NUL)
162       {
163         /* List all compiler scripts. */
164         do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')");
165       }
166       else
167       {
168         buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
169         if (buf != NULL)
170         {
171             do_unlet((char_u *)"current_compiler");
172             sprintf((char *)buf, "compiler/%s.vim", eap->arg);
173 !           (void)cmd_runtime(buf, TRUE);
174             vim_free(buf);
175         }
176       }
177   }
178 --- 1756,1828 ----
179   
180   #ifdef FEAT_EVAL
181   /*
182 !  * ":compiler[!] {name}"
183    */
184       void
185   ex_compiler(eap)
186       exarg_T   *eap;
187   {
188       char_u    *buf;
189 +     char_u    *old_cur_comp = NULL;
190 +     char_u    *p;
191   
192       if (*eap->arg == NUL)
193       {
194         /* List all compiler scripts. */
195         do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')");
196 +                                       /* ) keep the indenter happy... */
197       }
198       else
199       {
200         buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
201         if (buf != NULL)
202         {
203 +           if (eap->forceit)
204 +           {
205 +               /* ":compiler! {name}" sets global options */
206 +               do_cmdline_cmd((char_u *)
207 +                                  "command -nargs=* CompilerSet set <args>");
208 +           }
209 +           else
210 +           {
211 +               /* ":compiler! {name}" sets local options.
212 +                * To remain backwards compatible "current_compiler" is always
213 +                * used.  A user's compiler plugin may set it, the distributed
214 +                * plugin will then skip the settings.  Afterwards set
215 +                * "b:current_compiler" and restore "current_compiler". */
216 +               old_cur_comp = get_var_value((char_u *)"current_compiler");
217 +               if (old_cur_comp != NULL)
218 +                   old_cur_comp = vim_strsave(old_cur_comp);
219 +               do_cmdline_cmd((char_u *)
220 +                             "command -nargs=* CompilerSet setlocal <args>");
221 +           }
222             do_unlet((char_u *)"current_compiler");
223 +           do_unlet((char_u *)"b:current_compiler");
224
225             sprintf((char *)buf, "compiler/%s.vim", eap->arg);
226 !           if (cmd_runtime(buf, TRUE) == FAIL)
227 !               EMSG2(_("E666: compiler not supported: %s"), eap->arg);
228             vim_free(buf);
229
230 +           do_cmdline_cmd((char_u *)":delcommand CompilerSet");
231
232 +           /* Set "b:current_compiler" from "current_compiler". */
233 +           p = get_var_value((char_u *)"current_compiler");
234 +           if (p != NULL)
235 +               set_internal_string_var((char_u *)"b:current_compiler", p);
236
237 +           /* Restore "current_compiler" for ":compiler {name}". */
238 +           if (!eap->forceit)
239 +           {
240 +               if (old_cur_comp != NULL)
241 +               {
242 +                   set_internal_string_var((char_u *)"current_compiler",
243 +                                                               old_cur_comp);
244 +                   vim_free(old_cur_comp);
245 +               }
246 +               else
247 +                   do_unlet((char_u *)"current_compiler");
248 +           }
249         }
250       }
251   }
252 *** ../vim-6.2.407/src/version.c        Fri Mar 26 22:33:25 2004
253 --- src/version.c       Sat Mar 27 13:20:14 2004
254 ***************
255 *** 639,640 ****
256 --- 639,642 ----
257   {   /* Add new patch number below this line */
258 + /**/
259 +     408,
260   /**/
261
262 -- 
263 hundred-and-one symptoms of being an internet addict:
264 163. You go outside for the fresh air (at -30 degrees) but open the
265      window first to hear new mail arrive.
266
267  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
268 ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
269 \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
270  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
This page took 0.129847 seconds and 3 git commands to generate.