Andy Wokula wrote:
> Am 08.05.2017 um 12:53 schrieb Bram Moolenaar:
> > For flexibility this needs to work recursively. We could do something
> > like:
> >
> > let saved_options = options_save()
> > ... do your stuff ...
> > call options_restore(saved_options)
> >
> > The options being saved should be small to keep this efficient. We need
> > to make a list of the ones that are useful, such as 'ignorecase' and
> > 'gdefault'.
>
> What about a different approach:
>
> Have a mode (for debugging only) in which builtin commands and functions
> complain when options they use are not at the default value.
> This way the script writer learns which options need to be set and restored.
Suppose we add a new option which, when set, interferes with some plugins.
With the options_save()/options_restore() approuch we can avoid breaking
plugins without making any changes. With your method we would need to wait for
plugin writers to update for the new option, which can take a long time.
> (maybe: When used at toplevel (at the cmdline) there is no warning)
>
> The advantage is that exactly the required options are set and restored.
>
>
> And I'm not sure if the "last set from" info would work after options_save().
It woud be restored as well.
--
No man may purchase alcohol without written consent from his wife.
[real standing law in Pennsylvania, United States of America]
/// Bram Moolenaar -- [email protected] -- 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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.