zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: PATCH: trailing components
Date: Tue, 18 Jun 2019 15:39:14 +0000	[thread overview]
Message-ID: <1560872353.7731.23.camel@samsung.com> (raw)
In-Reply-To: <CAHYJk3TKWjvPjSi3_p1nzs9giBuLOEAghhOB__Of1veb9+4FPg@mail.gmail.com>

On Tue, 2019-06-18 at 16:45 +0200, Mikael Magnusson wrote:
> The only complaint I could imagine here (but I'm not making it) is
> that this breaks
> echo $foo:t42
> to echo the last path segment followed by the string 42
> Would it be possible to limit the new syntax to *(:t42) and ${foo:t42}
> where previously the 34 is invalid (or at least silently ignored)? If
> it is I think it would be nice to do so, but I'm not going to object
> if it goes in as is. It's certainly nicer than the expressions
> suggested earlier in the thread.

That's straightforward.  The same problem applies to !-history, but (i)
what you see is what you get in that case (ii) that's exactly the place
where brevity is particularly valuable, so maybe I can just document
that as a small incompatibility.

Looks like it's worth going ahead.  I would think doing the same for :h
makes sense, if only for consistency:  it would be a bit odd to have one
and not the other.  I'll make them both mean the number of components to
leave, even though the default behaviour is different, with head taking
off one path and tail leaving one path.  I think the way repeated head
works means that / is one and /foo is two components.

pws



  reply	other threads:[~2019-06-19  8:07 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
2019-06-18 14:45       ` Mikael Magnusson
2019-06-18 15:39         ` Peter Stephenson [this message]
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=1560872353.7731.23.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).