From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23209 invoked from network); 17 Jan 2009 03:59:42 -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; 17 Jan 2009 03:59:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 255 invoked from network); 17 Jan 2009 03:59:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jan 2009 03:59:38 -0000 Received: (qmail 6073 invoked by alias); 17 Jan 2009 03:59:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26332 Received: (qmail 6061 invoked from network); 17 Jan 2009 03:59:33 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 17 Jan 2009 03:59:33 -0000 Received: from mx.spodhuis.org (redoubt.spodhuis.org [193.202.115.177]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 4A97580271F0 for ; Sat, 17 Jan 2009 04:59:30 +0100 (CET) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=cZDJhgM16inN67uZYbu9GC2Ve97o35tIza3mSnUR59j3++Hr3DFX0zShMfkx4cKaq1aATkkzupVK8KCVXKiMUF0T/FKx102QsGpqRaa3A/fK4FdGZrJ51RXQ5SUoregHp3HeJNUG89clo+x88A7CBXKVvE5ZA1aiWo8EgA4wH4g=; Received: by smtp.spodhuis.org with local id 1LO2LD-000Ov0-ND; Sat, 17 Jan 2009 03:59:23 +0000 Date: Fri, 16 Jan 2009 19:59:23 -0800 From: Phil Pennock To: Bart Schaefer Cc: zsh-workers@sunsite.dk Subject: Re: sourcing a sh file in zsh Message-ID: <20090117035923.GA64953@redoubt.spodhuis.org> Mail-Followup-To: Bart Schaefer , zsh-workers@sunsite.dk References: <090116075615.ZM21871@torch.brasslantern.com> <200901161939.54651.arvidjaar@newmail.ru> <090116102934.ZM22119@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <090116102934.ZM22119@torch.brasslantern.com> X-Virus-Scanned: ClamAV 0.92.1/8873/Sat Jan 17 04:33:31 2009 on bifrost X-Virus-Status: Clean On 2009-01-16 at 10:29 -0800, Bart Schaefer wrote: > with the obvious meaning of "turn on sh emulation while sourcing" and > would otherwise behave like "source". Might need a variant that has > the path-searching semantics of "." as well. Isn't there a problem where a function is defined which assumes one set of semantics and the reset afterwards changes the semantics? Thus the reason why the entry points into completion set the relevant emulation options. Really, we need to be able to have a function "remember" the options in effect at the time it was defined and restore them, without having to call emulate within them. At $work there are some shell libraries which I could use if this were doable, which is why my notes of Things I Want To Get Around To Making Zsh Support includes this item: ----------------------------8< cut here >8------------------------------ zsh setopt inherit_options When set, functions defined remember the options set at time of definition, so it's similar to an automatic "emulate" in them. Most usefully: setopt local_options inherit_options function fred { setopt localoptions shwordsplit; alpha="foo bar baz bat"; print -l $alpha; function barney { print -l $alpha } } (Multi-shell compatibility libraries) ----------------------------8< cut here >8------------------------------ Thoughts, comments? I can see how to go about doing it but haven't gotten around to it yet. -Phil