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

Re: more dependencies on emulation



Zefram wrote:
> Continuing on from my FUNCTION_ARGZERO patch in article 1669, this
> patch removes some direct dependencies on emulation from subst.c.
> After this, the only use of emulation is in the emulate builtin itself,
> and in initialisation (where it's difficult to avoid).
> 
> There are two distinct uses of emulation addressed here.  One affects
> the position of filename expansion in the order of expansion; I add a
> new option, SH_FILE_SUBST, to control this.  This option is affected
> by changing emulation mode, so the current behaviour will be unchanged
> except where the new option is explicitly used.

I did not want to introduce new options like FUNCTION_ARGZERO and
SH_FILE_SUBST because I consider these options useful only in sh/ksh
compatibility mode.  Increasing the number of settable options makes it
more and more difficult to write zsh functions which are independent of the
current options setting.  But my solition was certainly not very good.

> The second use of emulation is to control whether the $foo[2] subscript
> placement will work; sh and ksh don't recognise it as a subscript.
> The patch makes this be controlled by the KSH_ARRAYS option, as it should
> have been all along.  The KSH_ARRAYS option is also changed to be set
> by default when emulating sh, which was previously not essential.

That's fine for me.

> Both of the above optional behaviours are also documented by this patch.
> Previously they were totally undocumented.

I wanted to write a compatibility section in zshmisc.man but that major
crash we had last weekend took all of my time.

> My comments in article 1669 about the option patch in article 1275 apply
> here also.  Applying this patch by hand if you don't have the option
> patch applied is not difficult.  If anyone wants an updated copy of the
> option patch, mail me.

I'd like one.  I wanted to include this in pre3 but again I had no time.

Zoltan




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