From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29414 invoked from network); 7 Oct 1999 17:29:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Oct 1999 17:29:50 -0000 Received: (qmail 1588 invoked by alias); 7 Oct 1999 17:29:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8172 Received: (qmail 1581 invoked from network); 7 Oct 1999 17:29:45 -0000 Subject: Re: PATCH: emulate (Re: Prompt fun) In-Reply-To: <991007172015.ZM27237@candle.brasslantern.com> from Bart Schaefer at "Oct 7, 1999 5:20:15 pm" To: schaefer@candle.brasslantern.com (Bart Schaefer) Date: Thu, 7 Oct 1999 18:29:43 +0100 (BST) Cc: zsh-workers@sunsite.auc.dk X-Mailer: ELM [version 2.4ME+ PL48 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: From: Zefram 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 >problem cases. 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. -zefram