From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29310 invoked from network); 7 Oct 1999 17:20:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Oct 1999 17:20:38 -0000 Received: (qmail 29976 invoked by alias); 7 Oct 1999 17:20:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8171 Received: (qmail 29964 invoked from network); 7 Oct 1999 17:20:23 -0000 From: "Bart Schaefer" Message-Id: <991007172015.ZM27237@candle.brasslantern.com> Date: Thu, 7 Oct 1999 17:20:15 +0000 In-Reply-To: Comments: In reply to Zefram "Re: PATCH: emulate (Re: Prompt fun)" (Oct 7, 4:50pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: emulate (Re: Prompt fun) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 7, 4:50pm, Zefram wrote: } Subject: Re: PATCH: emulate (Re: Prompt fun) } } Bart Schaefer wrote: } >Hmm. I tend to think of it exactly the opposite way -- if I set errexit, } >I generally want it to continue to apply down through functions I call, } >because of exactly the circumstances you note -- scripts run from make, } >which uses -e when it invokes the shell. } } Hmm. Surely in that case, the functions in question are going to be ones } written to be executed in the context of that particular script, and } will be intended to have ERR_EXIT set, and won't have an emulate line? The function might be written so that zsh executes it as an autoload but bash runs it as a separate script process. In the former case, an emulate might be required. However, I admit that there is merit in your argument; it's just that I tend to want to resolve conflicts by *not* changing existing behavior ... 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. Scripts that need to port among different users' zsh configurations, as opposed to porting zsh<->ksh, were supposed to use "emulate -R" and then setopt exactly the options they needed. Perhaps the situation has changed enough, now that large parts of the zsh distribution are written as zsh scripts, that we should revisit that and make most of the changes in Zefram's patch. 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. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com