Re: Add :function defaults: resets some options that are likely to cause problems when function is run
> How frustrating would it be, to set 'eventignore' to BufRead, to prevent Vim from doing any processing on a buffer you intend to throw away anyway, only to have another plugin ignore your settings and do a bunch of stuff on the read anyway?How would it happen? You need explicit :e or like in :fun-defaults function because otherwise &ei setting will be restored back before autocommand in question has a chance to be run, no matter whether :fun-defaults function is run from non-ignored autocmd (it cannot cover more then :autocmd body, if it consists solely of “:call FunDefaults(…)”, much likely it will be restored before any other :autocmd is run, otherwise it covers only nested autocommands), plain function call/mapping/command which you for some reason put into event-ignoring block (it is restored before you create that buffer in this case) or such. The only case where it will happen is making :fun-defaults function open the buffer for you. I know no examples of the code where you make third-party (your own one can be edited and thus is your problem) function open the buffer for you, only some of third-party processing after the buffer was opened; and of that kind which is done without triggering autocommands, except for a few Shell*.
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