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

Re: 'emulate sh -c' and $0

On Jun 3, 2014 1:15 PM, "Richard Hansen" <rhansen@xxxxxxx> wrote:
> Wow, thank you for committing this change to master!  It works well in
> my limited testing, except for the documented limitation that
> POSIX_ARGZERO stays enabled when calling a non-emulated function from a
> function defined in 'emulate <shell> -c'.  I'm not sure how much this
> will matter in practice, but if backward compatibility wasn't a concern
> it'd be nice if zsh temporarily restored options when invoking a
> function outside the 'emulate <shell> -c' boundary.

What this is effectively requesting is that all functions have "sticky"
options, always.  We already rejected that idea for reasons of dynamic
scoping when originally designing "emulate ... -c".  I suppose a special
case could be made of POSIX_ARGZERO such that it is always sticky even when
other options are not, but that seems like an awful lot of effort for
something that doesn't matter most of the time.

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