From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21720 invoked from network); 5 Dec 2006 16:35:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) 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.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Dec 2006 16:35:44 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65096 invoked from network); 5 Dec 2006 16:35:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Dec 2006 16:35:38 -0000 Received: (qmail 23550 invoked by alias); 5 Dec 2006 16:35:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23033 Received: (qmail 23537 invoked from network); 5 Dec 2006 16:35:34 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Dec 2006 16:35:34 -0000 Received: (qmail 64783 invoked from network); 5 Dec 2006 16:35:34 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 5 Dec 2006 16:35:30 -0000 Received: from torch.brasslantern.com ([71.116.86.88]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0J9T007817F445X3@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Tue, 05 Dec 2006 10:35:29 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id kB5GZSnE024709 for ; Tue, 05 Dec 2006 08:35:28 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id kB5GZRml024708 for zsh-workers@sunsite.dk; Tue, 05 Dec 2006 08:35:27 -0800 Date: Tue, 05 Dec 2006 08:35:27 -0800 From: Bart Schaefer Subject: Re: Tab expansion of {* In-reply-to: To: zsh-workers@sunsite.dk Message-id: <061205083527.ZM24707@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: Comments: In reply to Dave Yost "Tab expansion of {*" (Dec 1, 4:14pm) On Dec 1, 4:14pm, Dave Yost wrote: } } Z% ls /usr/{* } } Zsh should expand this to } } Z% ls /usr/{X11R6,bin,include,lib,libexec,local,man,sbin,share,standalone} I'll assume you're referring to compsys-driven expansion rather than to what happens with only "zsh -f". This is tricky because by the time the _expand completer is called, something else has removed the open brace and the pattern appears to be "/usr/*". So there's no way for _expand to know that when it adds the all-expansions completion, it should join with a comma instead of with a space. In fact the open brace appears to have been removed by the C code even before _main_complete is called. _expand constructs the pattern from word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX" and the brace isn't in there. There doesn't appear to be anything in the compstate hash that would reveal that the brace used to be present, either. So the only approach seems to be to examine $words[CURRENT], which feels icky to me. And even if we got it right that way, I think the internals would end up adding a comma as the final word separator rather than a brace. Which is not necessarily wrong, as brace patterns aren't required to match real existing file names. Peter, any thoughts?