From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4343 invoked by alias); 12 Nov 2012 10:34:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30796 Received: (qmail 27231 invoked from network); 12 Nov 2012 10:34:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) Date: Mon, 12 Nov 2012 10:24:37 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Function code breaking out of if then ...fi Message-id: <20121112102437.2cb5d357@pwslap01u.europe.root.pri> In-reply-to: <20121110212330.0d74f97f@pws-pc.ntlworld.com> References: <121102143911.ZM14168@torch.brasslantern.com> <20121105142942.41d73d31@pwslap01u.europe.root.pri> <20121105145501.50c674f1@pwslap01u.europe.root.pri> <20121109225255.7139bb47@pws-pc.ntlworld.com> <121109171319.ZM4069@torch.brasslantern.com> <20121110212330.0d74f97f@pws-pc.ntlworld.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-TM-AS-MML: No On Sat, 10 Nov 2012 21:23:30 +0000 Peter Stephenson wrote: > On Fri, 09 Nov 2012 17:13:19 -0800 > Bart Schaefer wrote: > > When reading a startup file such as .zshrc, there is an intent to > > avoid skipping the entire configuration just because of one > > erroneous command somewhere in the middle. > > I've a vague memory of this too, but evidence suggests it's not > showing CONTINUE_ON_ERROR behaviour (this is before my patch): In fact, the code I've altered can't have an effect on this: as it says in the essay I wrote before, I'm modifying code above the "top-level" loop in loop(), that's called mainly to handle "do you really want to exit" for interactive shells. The initialisation code is not handled from here; run_init_scripts() has finised from this point. I think we'd need code within loop() itself, which handles the lines read from startup files. In this code the test if (((!interact || sourcelevel) && errflag) || retflag) break; ensures we *do* break out of the loop if we're sourcing a file (whether or not at initialisation). Hmm... we're not getting confused between keeping going in a particular startup file and allowing the shell to execute another file, are we? pws