From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21596 invoked from network); 22 Jun 2006 14:13:32 -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; 22 Jun 2006 14:13:32 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36562 invoked from network); 22 Jun 2006 14:13:26 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Jun 2006 14:13:26 -0000 Received: (qmail 4907 invoked by alias); 22 Jun 2006 14:13:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22508 Received: (qmail 4894 invoked from network); 22 Jun 2006 14:13:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Jun 2006 14:13:19 -0000 Received: (qmail 35871 invoked from network); 22 Jun 2006 14:13:19 -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; 22 Jun 2006 14:13:18 -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 k5MEDISZ028523 for ; Thu, 22 Jun 2006 14:13:18 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 k5MEDDgL016486 for ; Thu, 22 Jun 2006 14:13:13 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 k5MECM0p003850 for ; Thu, 22 Jun 2006 14:12:22 GMT In-reply-to: <060621064945.ZM17820@torch.brasslantern.com> From: Oliver Kiddle References: <060621064945.ZM17820@torch.brasslantern.com> To: zsh-workers@sunsite.dk Subject: Re: The (e) glob qualifier and NO_NOMATCH Date: Thu, 22 Jun 2006 16:12:22 +0200 Message-ID: <3849.1150985542@dcle12> Bart wrote: > Consider by comparison _path_files in the completion code, which includes > a hack to force auto-mounting. Wouldn't it be nice to be able to write a > function "forcemount" that matches a pattern against /etc/hosts or NIS > and mounts all those filesystems? Then you could use > > for remote in /net/r*(+forcemount); do ... > > This currently doesn't work, because once "r*" fails to match anything > in /net, the qualifiers are ignored and the entire string is returned as > the result. Instead we'd need to call "forcemount" with REPLY set to > the path segment pattern "r*". The main thing that makes (e) useful is that it runs the function once for each matched file. forcemount presumably is something that only needs to run once because the parameter you want to pass is an unexpanded pattern. Given that you can do something like: for remote in $(forcemount '/net/r*'); do ... is your point purely that you think the syntax would be nice or are you thinking in terms of being able to pass the function down through the completion system so that it is only run if and when _path_files expands the pattern? > don't seem to have the order-dependence that one might expect: > > print *(e:'reply=(${REPLY}x)':/) In many respects using (e) and modifying $reply makes it more of a modifier than a qualifier. Perhaps we should have had a :e modifier. > For the time being, I guess this is just food for thought. You might also find it interesting to look at the trick I used in _subversion for tricking globbing into generating files that don't exist. It does the following: _files -g ".svn(/e:_svn_deletedfiles:)" The use of .svn as the file is largely irrelevant. This works better than the similar functionality in _cvs because the rest of _file/_path_files is used). It isn't perfect due to the fact that the fake files can't have type information associated with them. Oliver