From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: The (e) glob qualifier and NO_NOMATCH
Date: Fri, 23 Jun 2006 11:53:17 +0200 [thread overview]
Message-ID: <3875.1151056397@dcle12> (raw)
In-Reply-To: <060622095121.ZM19569@torch.brasslantern.com>
Bart wrote:
> Rather I'm thinking in terms of the "search upwards but stop at the
> first file" glob request posted to zsh-users earlier this week. I
> wanted to say
>
> up() { reply=( (../)#$~REPLY(Odon) ); reply=( $reply[1] ) }
>
> less adr*(+up)
The closest I can think of that you can get to this is something like
the following:
up() { print -r "(../)#$1(Odon[1])" }
alias up='noglob up'
less ${~$(up adr*)}
That's not much easier to type but it might make more sense to allow
something like $~(up d*) to work than to add a glob qualifier that
alters the pattern.
In the case of the actual searching upwards problem, I've wondered in
the past whether some actual syntax would make sense. I mostly use it
for getting to Ant build.xml files and have considered using bindkey -s
so that something like '.**/' would expand to '(../)#'. A new syntax
could perhaps work a little differently than '(../)#' to avoid needing
(Odon[1]) or ([-1]). Stopping at the first directory that produces a
match is probably enough (searching up from .. to / not down from / to
..).
Oliver
prev parent reply other threads:[~2006-06-23 9:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-21 13:49 Bart Schaefer
2006-06-22 14:12 ` Oliver Kiddle
2006-06-22 16:51 ` Bart Schaefer
2006-06-23 9:53 ` Oliver Kiddle [this message]
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=3875.1151056397@dcle12 \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@sunsite.dk \
/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).