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

Set option in parent after emulate -L zsh



Hello,
doing:

% unsetopt promptsubst   # Should see garbage in prompt
% () { setopt promptsubst; }

restores correct prompt. Then, to handle emulate -L:

emulate -L zsh
unsetopt promptsubst
() { setopt promptsubst; }   # no change
() { unsetopt localoptions; setopt promptsubst; }   # prompt restored
echo $options[localoptions] $options[promptsubst]   # shows "on on"

I wonder what does the "unsetopt localoptions" do. It connects current
function's level with parent locallevel in context of options, not
harming parent "localoptions" setting? That would be the best
possibility, but I'm afraid something different might be happening
maybe?

-- 
  Sebastian Gniazdowski
  psprint3@xxxxxxxxxxxx



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