1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: There is no way to avoid ":doautoall" reading modelines.
12 Solution: Add the <nomodeline> argument. Adjust documentation.
13 Files: src/fileio.c, runtime/doc/autocmd.txt
16 *** ../vim-7.3.437/src/fileio.c 2012-02-11 23:45:30.000000000 +0100
17 --- src/fileio.c 2012-02-12 00:08:17.000000000 +0100
24 + char_u *arg = eap->arg;
25 + int call_do_modelines = TRUE;
27 + if (STRNCMP(arg, "<nomodeline>", 12) == 0)
29 + call_do_modelines = FALSE;
30 + arg = skipwhite(arg + 12);
34 * This is a bit tricky: For some commands curwin->w_buffer needs to be
37 aucmd_prepbuf(&aco, buf);
39 /* execute the autocommands for this buffer */
40 ! retval = do_doautocmd(eap->arg, FALSE);
42 ! /* Execute the modeline settings, but don't set window-local
43 ! * options if we are using the current window for another buffer. */
44 ! do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
46 /* restore the current window */
49 aucmd_prepbuf(&aco, buf);
51 /* execute the autocommands for this buffer */
52 ! retval = do_doautocmd(arg, FALSE);
54 ! if (call_do_modelines)
56 ! /* Execute the modeline settings, but don't set window-local
57 ! * options if we are using the current window for another
59 ! do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
62 /* restore the current window */
64 *** ../vim-7.3.437/runtime/doc/autocmd.txt 2011-05-19 17:25:36.000000000 +0200
65 --- runtime/doc/autocmd.txt 2012-02-12 00:03:45.000000000 +0100
68 autocommands for that group. Note: if you use an
69 undefined group name, Vim gives you an error message.
71 - After applying the autocommands the modelines are
72 - processed, so that their settings overrule the
73 - settings from autocommands, like what happens when
76 *:doautoa* *:doautoall*
77 ! :doautoa[ll] [group] {event} [fname]
78 Like ":doautocmd", but apply the autocommands to each
79 loaded buffer. Note that [fname] is used to select
80 the autocommands, not the buffers to which they are
82 autocommands for that group. Note: if you use an
83 undefined group name, Vim gives you an error message.
85 *:doautoa* *:doautoall*
86 ! :doautoa[ll] [<nomodeline>] [group] {event} [fname]
87 Like ":doautocmd", but apply the autocommands to each
88 loaded buffer. Note that [fname] is used to select
89 the autocommands, not the buffers to which they are
93 This command is intended for autocommands that set
94 options, change highlighting, and things like that.
96 + After applying the autocommands the modelines are
97 + processed, so that their settings overrule the
98 + settings from autocommands, like what happens when
99 + editing a file. This is skipped when the <nomodeline>
100 + argument is present.
102 ==============================================================================
103 10. Using autocommands *autocmd-use*
105 *** ../vim-7.3.437/src/version.c 2012-02-11 23:45:30.000000000 +0100
106 --- src/version.c 2012-02-12 00:16:04.000000000 +0100
110 { /* Add new patch number below this line */
116 "Oh, no! NOT the Spanish Inquisition!"
117 "NOBODY expects the Spanish Inquisition!!!"
118 -- Monty Python sketch --
119 "Oh, no! NOT another option!"
120 "EVERYBODY expects another option!!!"
121 -- Discussion in vim-dev mailing list --
123 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
124 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
125 \\\ an exciting new programming language -- http://www.Zimbu.org ///
126 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///