From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5496 invoked from network); 23 Jun 2006 09:54:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jun 2006 09:54:36 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 52873 invoked from network); 23 Jun 2006 09:54:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jun 2006 09:54:28 -0000 Received: (qmail 16035 invoked by alias); 23 Jun 2006 09:54:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22510 Received: (qmail 16026 invoked from network); 23 Jun 2006 09:54:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Jun 2006 09:54:24 -0000 Received: (qmail 52617 invoked from network); 23 Jun 2006 09:54:24 -0000 Received: from esacom89-ext.esoc.esa.int (HELO esacom89-int.esoc.esa.int) (131.176.86.4) by a.mx.sunsite.dk with SMTP; 23 Jun 2006 09:54:22 -0000 Received: from esacom53.esoc.esa.int (131-176-86-254.esoc.esa.int [131.176.86.254]) by esacom89-int.esoc.esa.int (8.13.3/8.13.3/ESA-External-v4.0) with ESMTP id k5N9sDND008629 for ; Fri, 23 Jun 2006 09:54:17 GMT Received: from dcle12.dev.esoc.esa.int (dcle12.dev.esoc.esa.int [131.176.58.71]) by esacom53.esoc.esa.int (8.12.10/8.12.10/ESA-Internal-v3.2) with ESMTP id k5N9s8aw014309 for ; Fri, 23 Jun 2006 09:54:08 GMT Received: from dcle12 (localhost [127.0.0.1]) by dcle12.dev.esoc.esa.int (8.13.4+Sun/8.13.3) with ESMTP id k5N9rHrD003876 for ; Fri, 23 Jun 2006 09:53:17 GMT In-reply-to: <060622095121.ZM19569@torch.brasslantern.com> From: Oliver Kiddle References: <060621064945.ZM17820@torch.brasslantern.com> <3849.1150985542@dcle12> <060622095121.ZM19569@torch.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: The (e) glob qualifier and NO_NOMATCH Date: Fri, 23 Jun 2006 11:53:17 +0200 Message-ID: <3875.1151056397@dcle12> 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