From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20617 invoked by alias); 11 May 2011 16:39:58 -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: 29229 Received: (qmail 29092 invoked from network); 11 May 2011 16:39:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Irhp5xvKHMmofQs4TOuZVwe6fNNlXaExUTfP1StU0tI=; b=hvr62tlYpbJ90d8N189TmPRmTQbfHHNLX2NvoTZSME2DVUJWeIzfEMKmapmJggmnbe ZwIctDLHV+00HwZkdxER+PrQeVueBPmktKFMe1ngv6fuDhA91xyvxWGyAdAb23sCaTq4 WXnwUNlOXWWZR2dvq4RGHy7j+IGqmqeGifuBQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xzYeYFD3CrZAQVWZXbbX4FEkjjwgrpMjvGSFgmGqA8mV2HRnbE/W77I8cWqCw4SN/X hmSNtRXVPYB23gqNQ+jckfjAljVNK6bgS8U1oYF6GAOhssF5acGAkfV2uZlv3n/p0++s E6Gm44tRi5LEoGk79m2kOZV2AZ2gZFNtN+VvI= MIME-Version: 1.0 In-Reply-To: <20110511172114.56080d04@pwslap01u.europe.root.pri> References: <1305118971-25617-1-git-send-email-mikachu@gmail.com> <20110511172114.56080d04@pwslap01u.europe.root.pri> Date: Wed, 11 May 2011 18:38:46 +0200 Message-ID: Subject: Re: PATCH: expanding parameters like echo/print builtins From: Mikael Magnusson To: Peter Stephenson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 11 May 2011 18:21, Peter Stephenson wrote: > On Wed, 11 May 2011 15:02:51 +0200 > Mikael Magnusson wrote: >> * The (@) flag; interacts obscurely with qt and isarr. >> * This is one of the things that decides whether multsub >> * will produce an array, but in an extremely indirect fashion. >> @@ -1932,6 +1936,36 @@ paramsubst(LinkList l, LinkNode n, char **str, >> int qt, int ssub) presc++; >> break; >> >> + case 'z': > > This might want to be 'g'. Indeed, I noticed this line had spaces instead of tabs, so while editing the patch file I copied the z line from the context and added a +, taking care to change the z to a g as I did so, but somehow didn't actually. So if this made you worry that I hadn't tested the patch, fear not :). Speaking of testing, should I add tests for this too? The c and e flags will have tendencies to output unprintable characters, can I write them in the expected test output somehow? Ie, it is probably not a good idea to write >${(g:c:):-^X} when testing that feature, since it'll break in the same way in both places. It is probably not likely that c specifically would break and everything else work, so I would personally be happy with just testing g:: and maybe g:o: too, since that's easy enough. In fact... --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -298,6 +298,14 @@ >Howzat >usay + foo='\u65\123' + print -r ${(g:o:)foo} + foo='\u65\0123' + print -r ${(g::)foo} +0:${(g)...} +>eS +>eS + foo='I'\''m nearly out of my mind with tedium' bar=foo print ${(P)bar} -- Mikael Magnusson