4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
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,
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
28 " Compiler: Miscrosoft Visual C
29 " Maintainer: Bram Moolenaar <Bram@vim.org>
30 ! " Last Change: 2001 Sep 24
32 if exists("current_compiler")
35 let current_compiler = "msvc"
37 " The errorformat for MSVC is the default.
38 ! setlocal errorformat&
39 ! setlocal makeprg=nmake
42 " Compiler: Miscrosoft Visual C
43 " Maintainer: Bram Moolenaar <Bram@vim.org>
44 ! " Last Change: 2004 Mar 19
46 if exists("current_compiler")
49 let current_compiler = "msvc"
51 + if exists(":CompilerSet") != 2 " older Vim always used :setlocal
52 + command -nargs=* CompilerSet setlocal <args>
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
62 ! *quickfix.txt* For Vim version 6.2. Last change: 2004 Feb 10
65 VIM REFERENCE MANUAL by Bram Moolenaar
67 ! *quickfix.txt* For Vim version 6.2. Last change: 2004 Mar 27
70 VIM REFERENCE MANUAL by Bram Moolenaar
73 =============================================================================
74 6. Selecting a compiler *compiler-select*
77 ! :comp[iler] {name} Set options to work with compiler {name}.
78 {not available when compiled without the
82 ! What this command actually does is:
83 ! - delete the "current_compiler" variable *current_compiler*
84 ! - execute ":runtime! compiler/{name}.vim"
86 For writing a compiler plugin, see |write-compiler-plugin|.
89 =============================================================================
90 6. Selecting a compiler *compiler-select*
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
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
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!"
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:
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.
122 For writing a compiler plugin, see |write-compiler-plugin|.
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
128 static char_u * make_expanded_name __ARGS((char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end));
131 - #if defined(FEAT_STL_OPT) || defined(PROTO)
133 * Set an internal variable to a string value. Creates the variable if it does
143 # if defined(FEAT_MBYTE) || defined(PROTO)
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
153 ! * ":compiler {name}"
161 if (*eap->arg == NUL)
163 /* List all compiler scripts. */
164 do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')");
168 buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
171 do_unlet((char_u *)"current_compiler");
172 sprintf((char *)buf, "compiler/%s.vim", eap->arg);
173 ! (void)cmd_runtime(buf, TRUE);
182 ! * ":compiler[!] {name}"
189 + char_u *old_cur_comp = NULL;
192 if (*eap->arg == NUL)
194 /* List all compiler scripts. */
195 do_cmdline_cmd((char_u *)"echo globpath(&rtp, 'compiler/*.vim')");
196 + /* ) keep the indenter happy... */
200 buf = alloc((unsigned)(STRLEN(eap->arg) + 14));
205 + /* ":compiler! {name}" sets global options */
206 + do_cmdline_cmd((char_u *)
207 + "command -nargs=* CompilerSet set <args>");
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>");
222 do_unlet((char_u *)"current_compiler");
223 + do_unlet((char_u *)"b:current_compiler");
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);
230 + do_cmdline_cmd((char_u *)":delcommand CompilerSet");
232 + /* Set "b:current_compiler" from "current_compiler". */
233 + p = get_var_value((char_u *)"current_compiler");
235 + set_internal_string_var((char_u *)"b:current_compiler", p);
237 + /* Restore "current_compiler" for ":compiler {name}". */
240 + if (old_cur_comp != NULL)
242 + set_internal_string_var((char_u *)"current_compiler",
244 + vim_free(old_cur_comp);
247 + do_unlet((char_u *)"current_compiler");
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
257 { /* Add new patch number below this line */
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.
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 ///