From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7408 invoked from network); 25 Jan 2009 12:20:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Jan 2009 12:20:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 33456 invoked from network); 25 Jan 2009 12:20:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jan 2009 12:20:39 -0000 Received: (qmail 10836 invoked by alias); 25 Jan 2009 12:20:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26431 Received: (qmail 10803 invoked from network); 25 Jan 2009 12:20:32 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Jan 2009 12:20:32 -0000 Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7F419802720F for ; Sun, 25 Jan 2009 13:20:20 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KE1002OF0XOBFW1@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 25 Jan 2009 06:20:15 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id n0PCKBn4025086 for ; Sun, 25 Jan 2009 04:20:11 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n0PCKBd6025085 for zsh-workers@sunsite.dk; Sun, 25 Jan 2009 04:20:11 -0800 Date: Sun, 25 Jan 2009 04:20:09 -0800 From: Bart Schaefer Subject: Re: sourcing a sh file in zsh In-reply-to: <200901251141.21647.arvidjaar@gmail.com> In-reply-to: <200901251156.04815.arvidjaar@gmail.com> To: zsh-workers@sunsite.dk Message-id: <090125042011.ZM25084@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200901241859.30029.arvidjaar@gmail.com> <090124151113.ZM24112@torch.brasslantern.com> <200901251141.21647.arvidjaar@gmail.com> <20090124173836.64403fdc@pws-pc> <090124152643.ZM24163@torch.brasslantern.com> <200901251156.04815.arvidjaar@gmail.com> Comments: In reply to Andrey Borzenkov "Re: sourcing a sh file in zsh" (Jan 25, 11:40am) Comments: In reply to Andrey Borzenkov "Re: sourcing a sh file in zsh" (Jan 25, 11:56am) X-Virus-Scanned: ClamAV 0.92.1/8901/Sun Jan 25 11:10:36 2009 on bifrost X-Virus-Status: Clean On Jan 25, 11:40am, Andrey Borzenkov wrote: } } [...] you are right, implying -L makes } both code and documentation simpler. [...] } } I personally would flag -LE as error then for the same reason as well } as do not confuse user who reads manuals. Let -L just always set } LOCAL_OPTIONS. Under the assumption that we carry through and cause the emulation mode or possibly other options to be automatically saved/restored for any functions defined in the emulate scope, the effect is going to be quite similar to that of setting LOCAL_OPTIONS globally. Consequently I think it makes little difference whether -L/-c are mutually exclusive; I'm OK with it either way. } emulate sh -c "some command" arg1 arg2 ... } } is valid (it is with shell, is not it?) This could be added later if } someone finds usage case. That's an interesting one. Yes, I could envision a case where one may want to have a local $argv in the emulate scope. } Yes, I am more and more inclined to make it "-c ..." ... OK to commit? I think so. On Jan 25, 11:56am, Andrey Borzenkov wrote: } } On 25 Jan 2009 02:26:43 Bart Schaefer wrote: } > On Jan 24, 5:38pm, Peter Stephenson wrote: } > } Subject: Re: sourcing a sh file in zsh } > } } > } You need quotes for defining functions in an } > } emulation, or to creating a separate file. } > } > Yeah, that was one of my reasons for pondering making it a reserved } > word or the like. } } If you are defining function in a *zsh* script, why not simply define it } as *zsh* function? emulate sh # ... emulate zsh -c "${$(<<\HERE function ... HERE)}" # ... Yeah, that's a bit contrived. --