Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from mail-qt0-f174.google.com by f.primenet.com.au (envelope-from <mikachu@gmail.com>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(209.85.216.174):SA:0(0.0/5.0):. 
 Processed in 0.124552 secs); 19 Jul 2016 00:21:48 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS,
	T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: mikachu@gmail.com
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.216.174 as permitted sender)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-transfer-encoding;
        bh=3/jT0pDvmSJ4M6EG8PxD9sUH+Z8P54OmO86X9D/onrQ=;
        b=hcdYx21yPKk0iaKdJW+4vP5Dc8KvxPsm1TjT651mZdN51x704edOJYmIuqbsc3OVMd
         xwJ20GCE2hXX+ThZ2Az3OPTiaOH27JPpNNvlJzRzMYMZwgaqudLx4fmu5xb2iVSwyCpS
         s9jMmbk35PVR461IgcTObjQrJJNUI+acz4+VQgvRUL3vA/exgzvU3+OXb6j69T4X2M05
         UemgqwrkA83N5Mka8mC/0cdrm/UfZbN0g3+xSKxc+2MF59AmlwroUHDnCt6KhAtcuvek
         SkBdDaGPHQm/FUq/rcwIqG/4TAJ0tSg192x3K5rL1s+9fqklj4AKs2n72rOn7i0E9Xa1
         Yuyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:content-transfer-encoding;
        bh=3/jT0pDvmSJ4M6EG8PxD9sUH+Z8P54OmO86X9D/onrQ=;
        b=gCKcF40LINS+S4mpxiRUsYlZPjIGzauK/KoI/iw50Bw6Lj2ASyXkSlc6440NuIQYLH
         S0DtFrX7ZN3qLCUGMP5qF9GQZcQ3AJMYOkqmMYSgFgYidckSh2t6rFeZ7XKPknFlBgU/
         wb47maDnMExR869r/layXbdDK1ex39qPWhkcGVaXaLEgVw+4sPtWTDnI+fy0prf6BRhg
         9Lnrawf82g14eo1WCDg/p5ZFK/9kCqwEJsU6lZGsMpY3wM3lJfsLXfzEvLMvrPU6xCJx
         8wlZGEsSUbgJ5foYCbOkBprx7JLAn3ChNAmc3J15PbcUediBxwtlGCv5ll/hx2z/eXS0
         Fw7g==
X-Gm-Message-State: ALyK8tIBHAnJkuptv5HeDerkZ1WKow/bURMOQ48K+pfoSFXsANFD/XHR154++p/FagUziPfR3CwwKiiLemvAdg==
X-Received: by 10.200.48.112 with SMTP id g45mr57246308qte.70.1468887700462;
 Mon, 18 Jul 2016 17:21:40 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <20160718203149.GA11086@mobil.systemanalysen.net>
References: <20160718203149.GA11086@mobil.systemanalysen.net>
From: Mikael Magnusson <mikachu@gmail.com>
Date: Tue, 19 Jul 2016 02:21:39 +0200
Message-ID: <CAHYJk3QPHyH30z+iZ8=o9WPviA4F_=sFMFwEeVdBq65GkWEddw@mail.gmail.com>
Subject: Re: Parameter + prompt expansion %D{%T.%.} parser issue
To: Roland Eggner <edvz2@systemanalysen.net>, zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Seq: zsh-workers 38883

On Mon, Jul 18, 2016 at 10:31 PM, Roland Eggner
<edvz2@systemanalysen.net> wrote:
> emulate -R zsh -c 'print -l ${(%):-%D{%T.%.} %~} "${(%):-%D{%T.%.} %~}" $=
{(%):-"%D{%T.%.} %~"}'
>
> Expected:
> 22:03:02.324 ~
> 22:03:02.324 ~
> 22:03:02.324 ~
>
> Observed:
> 22:03:02.324 ~
> 22:03:02.324 %~}
> 22:03:02.324 ~
>
>
> Note the trailing =E2=80=9C%~}=E2=80=9D in the 2nd line.
>
> ZSH_PATCHLEVEL=3Dzsh-5.2-282-ga22f4ea
> uname -m -o
> x86_64 GNU/Linux
>
> Usage error?  Bug?  Feature?

Usage error, but it's kind of hard to understand what's going on there
admittedly. When ${} is unquoted, then the parser "knows" which {}
belong together, but when you have them under double quotes the {} for
the %D are not special in any way, so the terminating } for %D matches
the ${ as well. You need "${(%):-%D{%T.%.\} %~}" (It would also be a
good idea to use -r for print when testing quoting things although in
this case it makes no difference.)

The same thing happens when you use %F{} etc.

--=20
Mikael Magnusson

