From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8073 invoked from network); 21 Jun 2006 13:50:30 -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=AWL,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; 21 Jun 2006 13:50:30 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 32935 invoked from network); 21 Jun 2006 13:50:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Jun 2006 13:50:23 -0000 Received: (qmail 25731 invoked by alias); 21 Jun 2006 13:50:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22504 Received: (qmail 25720 invoked from network); 21 Jun 2006 13:50:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 21 Jun 2006 13:50:19 -0000 Received: (qmail 32593 invoked from network); 21 Jun 2006 13:50:19 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 21 Jun 2006 13:50:18 -0000 Received: from torch.brasslantern.com ([71.116.105.50]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0J1700BPTQF2TLU4@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 21 Jun 2006 08:49:51 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k5LDnjul017822 for ; Wed, 21 Jun 2006 06:49:46 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k5LDnjpm017821 for zsh-workers@sunsite.dk; Wed, 21 Jun 2006 06:49:45 -0700 Date: Wed, 21 Jun 2006 06:49:43 -0700 From: Bart Schaefer Subject: The (e) glob qualifier and NO_NOMATCH To: zsh-workers@sunsite.dk Message-id: <060621064945.ZM17820@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii It occurs to me that, unlike most of the other glob qualifiers, (e:cmd:) doesn't necessarily need any existing filename on which to operate. 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*". Unfortunately it looks like this would need a pretty large reworking of the globbing code. The original source string of path segment patterns isn't kept around anywhere that I immediately see, and NO_NOMATCH is handled only after the entire scan has completed. Further, qualifiers don't seem to have the order-dependence that one might expect: print *(e:'reply=(${REPLY}x)':/) first finds all directories and then appends "x" to their names, rather than failing entirely because there are no directories having the names that result after appending an x to an existing name, and print *(e:'reply=(${REPLY}x)':e:'reply=(${REPLY}y)':) does not produce names with "xy" appended, only with "y". For the time being, I guess this is just food for thought. --