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

Re: Set option in parent after emulate -L zsh



On Thu, Mar 9, 2017, at 03:06 PM, Bart Schaefer wrote:
> The options
>   XTRACE
>   LOCAL_OPTIONS
>   LOCAL_LOOPS
>   WARN_NESTED_VAR
> are always reset on function scope exit.  The options
>   PRIVILEGED
>   RESTRICTED
> are never restored as an effect of LOCAL_OPTIONS (but might be in case
> of a "sticky emulation").

But this doesn't answer my question. I'm wondering what happens here:

() { unsetopt localoptions; setopt promptsubst; }   # prompt restored

Doing this I'm able to set promptsubst in caller (which used emulate
-LR). This looks like: option-scope of (anon) is equated with scope of
caller. Is it really what happens?

-- 
  Sebastian Gniazdowski
  psprint3@xxxxxxxxxxxx



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