On Mon, Nov 28, 2011 at 4:40 AM, Bram Moolenaar <[email protected]> wrote: > > Kana Natsuno wrote: > >> >From :help :doautocmd in Vim 7.3.353: >> >> > *:do* *:doau* *:doautocmd* *E217* >> > :do[autocmd] [group] {event} [fname] >> > >> > [...] >> > >> > After applying the autocommands the modelines are >> > processed, so that their settings overrule the >> > settings from autocommands, like what happens when >> > editing a file. >> >> [...] >> >> The current behavior seems to be odd, and it causes side effects at >> unexpected timing depending on user's configuration. I think that >> modelines should be processed while opening a file and it should not >> be >> processed other timing. >> >> Is the current behavior intended one? If so, what is the reason? > > The original idea of this command was to execute autocommands for > loading the buffer. So that you can trigger the right autocommands if > the file type wasn't detected.
Thank you for the reply. I understand the original intention about triggering modelines. > It would make sense to only trigger modelines when executing the > autocommands that are used when loading a buffer. That might be > complicated though. Alternatively we could add an argument to the > command to skip processing modelines. We could use the [!] flag, > although it might be a bit strange to have this effect. > Perhaps a <nomodeline> argument? I prefer <nomodeline> to the others. It is less complicated than the others, and it is backward compatible for existing scripts. I'll try to make a patch. -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
