Thilo Six wrote: > Thilo Six wrote the following on 17.10.2011 12:17 > > Hello Bram, > > > Additionally to already identified bogus files, where 'cpo-=C' is expected > > there > > are ones which actually expect an environment which has 'cpo-=l' set! > > > > IMHO those need to be fixed, too. > > > > Actually those 'cpo-=l' bugs are not as obvious. > > -- <snip> -- > > After thinking a little bit more about this issue I would like to ask you > Bram a > question about this. > Currently the approach seems to be that a vim script has to create a sane > environment on its own. > Maybe we should change that paradigm to: > When a vim script wants a insane environment it has to create it on its own. > > That means basically that we change vim to parse each file from $VIMRUNTIME as > if it would have been preceded with 'set cpo&vim'. > This basically leads to changing cpo from 'global only' to 'script local > only'. > The advantage seems to be, that vim would actually behave as script > maintainers > silently expect. > > Now the question Bram: What do you think about this? > > If we can't have the above (for what ever reason), can we require that each > and > every runtimefile has to handle cpo correctly on it's own, please?
I'm not sure if this is going to be a good solution. Setting and restoring options could be done specifically for syntax and indent files, but most other things can be sourced in a way that it's not directly clear that a $VIMRUNTIME file is being used. Also, what if the files are not under $VIMRUNTIME? Check 'runtimepath'? This starts getting tricky. What we could do is change $VIMRUNTIME/syntax/synload.vim and the place where indent files are loaded. But again, doing this for some scripts and not all might just cause confusion. It might be better to have a test to run all syntax files, indent scripts, etc in compatible mode and check if any of them fails. -- If your nose runs, and your feet smell, you might be upside down. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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