From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28451 invoked from network); 7 Oct 1999 15:51:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Oct 1999 15:51:06 -0000 Received: (qmail 21940 invoked by alias); 7 Oct 1999 15:50:56 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8166 Received: (qmail 21933 invoked from network); 7 Oct 1999 15:50:56 -0000 Subject: Re: PATCH: emulate (Re: Prompt fun) In-Reply-To: <991007154217.ZM27101@candle.brasslantern.com> from Bart Schaefer at "Oct 7, 1999 3:42:17 pm" To: schaefer@candle.brasslantern.com (Bart Schaefer) Date: Thu, 7 Oct 1999 16:50:24 +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: >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? emulate will be used in functions intended to be used in many places, and these functions should indicate errors by themselves returning with a non-zero status, which will come under the purview of the caller's ERR_EXIT setting. I've often written code like # I don't care if foo doesn't exist, so ignore the return code mv -f foo bar which, if it were in a generic function, shoud have "emulate -L zsh", and would be broken by ERR_EXIT being set unexpectedly. -zefram