From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12693 invoked from network); 25 Jan 2009 08:56:45 -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.6 required=5.0 tests=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 08:56:45 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65608 invoked from network); 25 Jan 2009 08:56:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jan 2009 08:56:40 -0000 Received: (qmail 3943 invoked by alias); 25 Jan 2009 08:56:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26426 Received: (qmail 3930 invoked from network); 25 Jan 2009 08:56:35 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Jan 2009 08:56:35 -0000 Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.181]) by bifrost.dotsrc.org (Postfix) with ESMTP id 99FAE80271F0 for ; Sun, 25 Jan 2009 09:56:31 +0100 (CET) Received: by ik-out-1112.google.com with SMTP id c28so665291ika.5 for ; Sun, 25 Jan 2009 00:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=KzxFu6JbLtdCE7lVXy7kvgSeKyYSRwTTBCdBTZREUNI=; b=O8HCSCZNyFA5OlpQOV8isDq78R24PLRqyCScaABI7e0haXboTbzX3fuaGoWhfes60X F5wXrevSUKrjSi7Vk74M+O/81nd5G6qkdW39ZA/5eRMn+D1xNdSho+arPdL+ra57H5U0 Tl56aCL0cT/jpMk1yIWQ0aGCDdN0E9FXyFo9o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=nMA6NzX0V6c+JHW1xaF5gEWvY/ZzcA2Sc+y0SYE6L1JlJSjqxcv+bIDzmPOOECV1Fa hYPeW7ir98P6mXqruAOGkYD6BxqOCuRlcCXvcU+3f1F3bYy2qUEuSDW2S3PIGMnDuSk5 tTw47gcBWcboSi+MFWxRZ/Wvqsvqpk66dPS/4= Received: by 10.210.117.1 with SMTP id p1mr1092985ebc.180.1232873791308; Sun, 25 Jan 2009 00:56:31 -0800 (PST) Received: from cooker.localnet (ppp91-77-239-56.pppoe.mtu-net.ru [91.77.239.56]) by mx.google.com with ESMTPS id 10sm6547992eyz.59.2009.01.25.00.56.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 25 Jan 2009 00:56:30 -0800 (PST) From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: sourcing a sh file in zsh Date: Sun, 25 Jan 2009 11:56:01 +0300 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc2-1avb; KDE/4.1.96; i686; ; ) References: <20090124173836.64403fdc@pws-pc> <090124152643.ZM24163@torch.brasslantern.com> In-Reply-To: <090124152643.ZM24163@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7441168.VsQiull3mp"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200901251156.04815.arvidjaar@gmail.com> X-Virus-Scanned: ClamAV 0.92.1/8900/Sun Jan 25 03:40:27 2009 on bifrost X-Virus-Status: Clean --nextPart7441168.VsQiull3mp Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 25 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2009 02:26:43 Bart Schaefer wrot= e: > 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=20 as *zsh* function? While I see usage cases for sourcing file under specific emulation (and=20 probably making it "sticky" for functions defined in it), I really do=20 not see why would you want to define a csh function in a zsh script. > } Hmm... I wonder if we should allow code from stdin > > That'd at least need another option, otherwise "emulate -E" would > always read standard input, which would be bad if it appeared in a > script and started evaluating whatever was written at it. > > } for things like: > } > } emulate -LRE sh < } function foo { > } ... > } } > } HERE > > You can always do > > emulate -LRE sh $(<<-\HERE > function foo { > ... > } > HERE) > Actually you can always do foo=3D$(<<-\HERE function foo { ... } HERE) emulate -c sh $foo > I'm not sure offhand if you could double-quote all of that, easily > ... > > } There's still the issue of retaining the emulation mode for > functions } defined in that mode; I agree we really ought to tackle > that to make } the new functionality properly useful. I expect Bart > has ideas on the } next step; how far will we need to go? > > I refer you to workers/26336 where Phil makes some comments about how > he'd modify the wordcode to handle this. > Assuming this is supported by zsh internals it is trivial to add option=20 to emulate to set "sticky" bit during code evaluation. --nextPart7441168.VsQiull3mp Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkl8KSQACgkQR6LMutpd94wCOwCfYnubm/0uw6R+yLgpusICcQpS sh4An2TaFBvOy16mY4xZ2faPGeDxk8Ao =Y5Yr -----END PGP SIGNATURE----- --nextPart7441168.VsQiull3mp--