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

Re: localoptions, emulate -L, and top-level shell

On Sat, 3 Dec 2016 08:23:43 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> Bart Schaefer wrote on Fri, Dec 02, 2016 at 15:50:33 -0800:
> > I'm wondering whether "setopt localoptions", including via "emulate -L",
> > perhaps ought to at least grumble if its state changes from unset to set
> > at the top level of an interactive shell.
> > 
> > Can wait until after 5.3, obviously.  Just thinking "aloud."
> Perhaps some people intentionally setopt localoptions in .zshrc so that
> no plugin can change global options... but then, a plugin doing «setopt
> nolocaloptions foo» would still set 'foo' globally, despite the zshrc
> setting.

I think setting localoptions globally for the benefit of safety with
your own functions is a perfectly reasonable usage --- and it's also
compatible with supplied functions, which will happily leave the glocal
setting alone, so probably best not to do anything to undermine it

I'm vaguely aware of having used "nolocaloptions" to pass up option
settings in the past, but I don't think there are standard functions
that do that.


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