Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: emulate (Re: Prompt fun)
- X-seq: zsh-workers 8172
- From: Zefram <zefram@xxxxxxxx>
- To: schaefer@xxxxxxxxxxxxxxxxxxxxxxx (Bart Schaefer)
- Subject: Re: PATCH: emulate (Re: Prompt fun)
- Date: Thu, 7 Oct 1999 18:29:43 +0100 (BST)
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: <991007172015.ZM27237@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Oct 7, 1999 5:20:15 pm"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
>Which reminds me: I believe the original intent of "emulate" was not to
>reset _all_ options that might affect parsing (unless "emulate -R" is
>used). I believe the intent was to reset any option that would confuse
>a ksh or sh script running in zsh. Options like "cdablevars" and "autocd"
>were *not* handled by "emulate" because no reasonable ksh script could
>possibly depend upon those behaviors, nor could a correctly-working ksh
>script use syntax that could accidentally trigger them.
Those two will rarely make any difference. I can imagine, though,
scripts that tentatively attempt to execute a command, and may well have
unexpected behaviour if they start cd'ing around as a result.
emulate -R is there to change the shell completely to the specified
emulation, as if it had been started under that name. It's useful
primarily in interactive shells. emulate without -R is supposed to
emulate (hence the name) the specified shell, as much as necessary for
scripts to be able to run unchanged (subject to the limited capabilities
of zsh to emulate other shells). To do this, emulate without -R really
needs to set all options that affect script behaviour.
> On the other hand, I'm as
>usual loathe to make "silent" changes to the option semantics. I'd much
>rather see an additional flag to "emulate" that catches these additional
So when would we use this additional flag? It would have to be used
essentially all the time, with plain emulate left just for backward
compatibility. I find it difficult to believe that anything actually
relies on "emulate zsh" *not* resetting EXTENDED_GLOB.
Messages sorted by: