From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9825 invoked from network); 27 Jan 2009 16:29:28 -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; 27 Jan 2009 16:29:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 26269 invoked from network); 27 Jan 2009 16:29:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jan 2009 16:29:19 -0000 Received: (qmail 29207 invoked by alias); 27 Jan 2009 16:29:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26461 Received: (qmail 29189 invoked from network); 27 Jan 2009 16:29:14 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 27 Jan 2009 16:29:14 -0000 Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by bifrost.dotsrc.org (Postfix) with ESMTP id 883488028ACA for ; Tue, 27 Jan 2009 17:29:10 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KE50015M1RZR7M2@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 27 Jan 2009 10:28:53 -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 n0RGSkCn020526 for ; Tue, 27 Jan 2009 08:28:46 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n0RGSj5P020525 for zsh-workers@sunsite.dk; Tue, 27 Jan 2009 08:28:45 -0800 Date: Tue, 27 Jan 2009 08:28:45 -0800 From: Bart Schaefer Subject: Re: sourcing a sh file in zsh In-reply-to: <2d460de70901261651t40f934aam21068aeaea262775@mail.gmail.com> To: zsh-workers@sunsite.dk Message-id: <090127082845.ZM20524@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200901251156.04815.arvidjaar@gmail.com> <2d460de70901250225g37845bftbbf4b87f12997a7c@mail.gmail.com> <200901251341.44463.arvidjaar@gmail.com> <20090126230713.GA18017@redoubt.spodhuis.org> <2d460de70901261651t40f934aam21068aeaea262775@mail.gmail.com> Comments: In reply to Richard Hartmann "Re: sourcing a sh file in zsh" (Jan 27, 1:51am) X-Virus-Scanned: ClamAV 0.92.1/8910/Tue Jan 27 15:30:53 2009 on bifrost X-Virus-Status: Clean On Jan 27, 1:51am, Richard Hartmann wrote: } Subject: Re: sourcing a sh file in zsh } } On Tue, Jan 27, 2009 at 00:07, Phil Pennock } wrote: } } > What I do like with the } > setopt approach is that there's a way for zsh to test if this is } > currently the case. This does raise an interesting edge case. What happens if one invokes "eumulate" (without the "-c") inside a sticky emulation context? Does it turn off the sticky, or does the new emulation become sticky? This question needs to be answered whether or not stickiness is implemented as a setopt. My inclination is to say that it turns off the sticky, but in that case "emulate -L" ought to restore stickyness again. Maybe the right way to do this is with a stack of emulation contexts. Using -L or -c creates one, otherwise emulate modifies the current one. That would parallel the LOCAL_OPTIONS semantics ... and I suppose may be an argument in favor of adding a setopt, though I'm still leery of that for other reasons. } > Eg, for bash/zsh portability, you could do: } > if [[ -n $ZSH_VERSION && -o sticky_options ]] } > since both support [[ conditional ]] and both support -o as a unary } > prefix test (both using it for testing shell options). } } emulate could simply set $ZSH_STICKY to 'sh' or something We've already made "emulate" with no arguments return the current emulation mode. Perhaps it could append the -c when sticky emulation is in effect. That would make [[ $(emulation) = zsh ]] a bit less useful ... you'd have to do [[ $(emulation) = zsh* ]] ... hmm.