From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19859 invoked by alias); 17 Oct 2017 17:41:55 -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: List-Unsubscribe: X-Seq: 41924 Received: (qmail 23908 invoked by uid 1010); 17 Oct 2017 17:41:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.54):SA:0(-2.1/5.0):. Processed in 2.781773 secs); 17 Oct 2017 17:41:55 -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=-2.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=UZgQUh/ocXuMFGtqjRNZcLAmmaoNPO8D2fJNf+WO4r0=; b=Qfb7iLFzBlra1WRbwpfoRsmulBWZDZxqZ46Str/e7F3NV+28taZhj2s7Qu9wCmwEny CI/lxQC1iElW5kSbYApIb5q1O60A8vC5+5Ixo/iXSNeL5PORxvfyoC8qeKCXe98Cv5XJ g62OfGtCJEnGQN2kTywxMJmmlIh065v3t+ZidGsu9hdsCt2J0gVVAvkWchxJBoS+1e71 ijrLnZjSPEX7P2ZS6G9P9KVZ+KrpmpJ0mcQPbsPf1XyY/6AGh79IWD82W2uUMWKcKi3T wDMKri750dQh30uu+yo/JyxZ+8UQ2rEMYcWB6bigQ+4R/M8xBxdcoDCDISuJSilZt/wz BCPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=UZgQUh/ocXuMFGtqjRNZcLAmmaoNPO8D2fJNf+WO4r0=; b=GdUioaZ04xegHEknGG06CK4M3bhQZMiQ9ovPU8s6Hhmg1XrMfQBCqQblps2uwtCR2B j7msMnPDhhVY1Wpd0idhBSWobkg08ic9yHToOeN9ZFkRV/+CysMlCKt0rpUK2y+qJ8Tt 9JhQvxZhPgz8YYc8jF27YKuNr0TXlaAJpgk9cSCR+QGEcOJIojKkNLXu5gmPdag8Oupj H4yApcH2b9O2PVwy8qejiGVBj+oXzAZxUN6y+iDJ46z3iPFcsqONR/g0DLkQtGQnX2kT kIALs2SEvRf3vSJmoA+NFHpjP0Wdaxg0Grj00a5WKNH7BYTO5GHh8i581P8yVotdP9Dk UeLA== X-Gm-Message-State: AMCzsaXClBZ8OLCZJM27CubEr/DQWFbad1IOdxanC5cxqRpUVzx4h9wb U4Zr8yj/ce5GHM/RqdWeebkYQEbhloE= X-Google-Smtp-Source: ABhQp+QnmSE3XC5jjXS0AdOoL7gcHHcpBVFuPNEt6Zr8cVIQuOoKWEr2rE1cQIKiW7rU9tV/gx7yPg== X-Received: by 10.36.54.195 with SMTP id l186mr6150596itl.37.1508262108977; Tue, 17 Oct 2017 10:41:48 -0700 (PDT) From: dana Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [PATCH] Documentation incorrect re: (w) subscript flag Message-Id: Date: Tue, 17 Oct 2017 12:41:48 -0500 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3273) The documentation for the (w) subscript flag states: > If the parameter subscripted is a scalar then this flag makes = subscripting > work on words instead of characters. The default word separator is = whitespace. > This flag may not be used with the i or I flag. The last bit is not accurate =E2=80=94 it does have an effect (one of = the two that i would consider 'expected') when used with (i) and (I): % str=3D'a bbb bb bb'; print ${str[(i)bb]} 3 % str=3D'a bbb bb bb'; print ${str[(iw)bb]} 7 % str=3D'a bbb bb bb'; print ${str[(Iw)bb]} 10 Daniel wasn't sure how to correctly document this behaviour. Might i = suggest the following? dana diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index 5757111b2..b569a9358 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -328,8 +328,10 @@ startitem() item(tt(w))( If the parameter subscripted is a scalar then this flag makes subscripting work on words instead of characters. The default word -separator is whitespace. This flag may not be used with the tt(i) or -tt(I) flag. +separator is whitespace. When combined with the tt(i) or tt(I) flag, +the effect is to produce the index of the first character of the +first/last word which matches the given pattern; note that a failed +match in this case always yields 0. ) item(tt(s:)var(string)tt(:))( This gives the var(string) that separates words (for use with the