zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: PATCH: trailing components
Date: Tue, 18 Jun 2019 14:54:47 +0100	[thread overview]
Message-ID: <1560866087.7731.18.camel@samsung.com> (raw)
In-Reply-To: <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(<stuff-here>)

even if <stuff-here> 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



  reply	other threads:[~2019-06-18 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190618130008eucas1p176cc19c1c8b831fc30b4bf7b3294f3af@eucas1p1.samsung.com>
2019-06-18 13:00 ` Peter Stephenson
2019-06-18 13:37   ` Daniel Shahaf
2019-06-18 13:54     ` Peter Stephenson [this message]
2019-06-18 14:45       ` Mikael Magnusson
2019-06-18 15:39         ` Peter Stephenson
2019-06-18 19:37       ` Daniel Shahaf
2019-06-19 15:02         ` Peter Stephenson
2019-06-20 10:14           ` Peter Stephenson
2019-06-18 14:42     ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560866087.7731.18.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).