Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: emulate -R resets localoptions



Andrej Borsenkow wrote:
>emulate -R seems to reset *all* options, in particular localoptions.

That's what it's supposed to do.  At least, it is supposed to reset all
configuration options -- it does not set the options relating to the
state of the shell, such as INTERACTIVE and PRIVILEGED.

>              it breaks my simple notion, that I should be able to say
>
>function foo() {
>    setopt localoptions
>
>and then set *any* option without fear, that it will mess the caller.

You can't set NO_LOCAL_OPTIONS without fear in any case.  Your `simple
notation' is wrong -- you should set LOCAL_OPTIONS *after* setting
other options.  LOCAL_OPTIONS is tested when the function returns,
not when options are set.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author