From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 87a406bd for ; Tue, 18 Jun 2019 13:55:34 +0000 (UTC) Received: (qmail 29321 invoked by alias); 18 Jun 2019 13:55:29 -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: 44423 Received: (qmail 2076 invoked by uid 1010); 18 Jun 2019 13:55:29 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25482. spamassassin: 3.4.2. Clear:RC:0(210.118.77.11):SA:0(-7.0/5.0):. Processed in 3.633636 secs); 18 Jun 2019 13:55:29 -0000 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.samsung.com designates 210.118.77.11 as permitted sender) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190618135451euoutp011d827d82fe589036a266727fe6c797ee~pT3Cinz_J3193931939euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1560866091; bh=5lDYB7Ev3bvX2E6SogEjTr3SIZbcmFz7WfSvIW5Sazs=; h=Subject:From:To:Date:In-Reply-To:References:From; b=p3U5Zzl/J5Zsm/kIBC6d5Cvp+ozRoF5H58AjinyvqGKrpyZizCOC3rgaVuuJhbZzc 62erXbmaGQ8eBgDX1iFJzHsmvSMkk6ScwNT2XDQRZ7hiLVt7i/gwTLQn3n4cOTp6dr 8TBPYDm2USe8ge0YHzFddBOYH+ZP2mgKs2qxwdpU= X-AuditID: cbfec7f2-f13ff700000010ca-e6-5d08ed2adaab Message-ID: <1560866087.7731.18.camel@samsung.com> Subject: Re: PATCH: trailing components From: Peter Stephenson To: Date: Tue, 18 Jun 2019 14:54:47 +0100 In-Reply-To: <523ba6f0-651a-444a-8ceb-c7c4ec186b20@www.fastmail.com> X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsWy7djP87pabzliDf4t4rU42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGR/6FAomcVUsO/yFpYGxlaOLkZNDQsBEYtLVJ4xdjFwcQgIr GCUuHmthgnD6mCTmzF8Plellkth98zMzTMvnPVugqpYzSmzb9IsJrqp7xjSwKiGBM4wSU9Ym QCQuMEqcal7ABJLgFTCSOPelnxHEFhZQl9iwZi8biM0mYCgxddNssLiIgKTEtebTYDaLgKrE uV0HWEBsTgEXifv7JrBDnKEhseHmMaiZghInZz4Bq2EWkJdo3jqbGWSxhMBjNokvffMZIRpc JPretLNA2MISr45vgRokI3F6cg8LREM7o8SaSa/ZIZweRolNR+9AdVtL9N2+CGRzAK3QlFi/ Sx8i7Cix/OguVpCwhACfxI23ghBH8ElM2jadGSLMK9HRJgRRrSaxo2krI0RYRuLpGoUJjEqz kHwwC8kHsxBWLWBkXsUonlpanJueWmyYl1quV5yYW1yal66XnJ+7iRGYCk7/O/5pB+PXS0mH GAU4GJV4eCWa2WOFWBPLiitzDzFKcDArifBONeaIFeJNSaysSi3Kjy8qzUktPsQozcGiJM5b zfAgWkggPbEkNTs1tSC1CCbLxMEp1cDYmfz3+iGXlgtqbrs0Wayn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CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190618130008eucas1p176cc19c1c8b831fc30b4bf7b3294f3af X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190618130008eucas1p176cc19c1c8b831fc30b4bf7b3294f3af References: <1560862806.7731.11.camel@samsung.com> <523ba6f0-651a-444a-8ceb-c7c4ec186b20@www.fastmail.com> On Tue, 2019-06-18 at 13:37 +0000, Daniel Shahaf wrote: > Peter Stephenson wrote on Tue, 18 Jun 2019 13:01 +00:00: > >  > > I needed to preserve a number of trailing components of a path (other > > than one) and couldn't think of an easy way of doing it.  Rather than > > craft obscure pattern substitutions, or use an ad-hoc expression to > > strip the prefix, I came up with a patch to add an optional number after > > the "t" in history style modifiers to do this.  I put it after rather > > than before because history-style colon expressions are quite sensitive > > to what the first character is after the colon. > >  > > Before I come up with tests and fix up the ensuing failures, you can let > > me know if there's a better way of doing this to save me the trouble. > Here are some alternatives, but I'm not claiming any of them is better than «${foo:t2}»: Thanks, it's useful to know other people's thinking for comparison --- to be clear, what I was hoping for and lacking was something along the lines of: echo /blah/blah/blah/**/*.oogabooga() even if wasn't quite as short as :t2.  I could live with a few more characters but a loop or complicated substitution would lead me to propose adding the new code instead. pws