From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11274 invoked from network); 22 Feb 2009 00:58:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Feb 2009 00:58:05 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 42989 invoked from network); 22 Feb 2009 00:57:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Feb 2009 00:57:59 -0000 Received: (qmail 24780 invoked by alias); 22 Feb 2009 00:57:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26592 Received: (qmail 24764 invoked from network); 22 Feb 2009 00:57:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 22 Feb 2009 00:57:53 -0000 Received: from vms173017pub.verizon.net (vms173017pub.verizon.net [206.46.173.17]) by bifrost.dotsrc.org (Postfix) with ESMTP id CC6F280293E7 for ; Sun, 22 Feb 2009 01:57:49 +0100 (CET) Received: from torch.brasslantern.com ([173.67.122.60]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KFG002F900BP7ML@vms173017.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 21 Feb 2009 18:57:48 -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 n1M0vkXj013032 for ; Sat, 21 Feb 2009 16:57:47 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n1M0vjmX013031 for zsh-workers@sunsite.dk; Sat, 21 Feb 2009 16:57:45 -0800 From: Bart Schaefer Message-id: <090221165745.ZM13030@torch.brasslantern.com> Date: Sat, 21 Feb 2009 16:57:45 -0800 In-reply-to: <090221111624.ZM12907@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: globcomplete desctroys file completion" (Feb 21, 11:16am) References: <090221111624.ZM12907@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@sunsite.dk Subject: Re: globcomplete desctroys file completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.92.1/9021/Sun Feb 22 00:17:19 2009 on bifrost X-Virus-Status: Clean On Feb 21, 11:16am, Bart Schaefer wrote: } } Interesting. Comparing the traces I find that at _path_files:238 with } globcomplete, menu=yes is being set, and at _path_files:623 the value } of $compstate[pattern_match] is "*" so the code branches to line 667 } instead of 629. This sends us around the (for i in "$tmp1[@]"; do) } loop at line 673 a bunch of times, each time adding either "texlive" } or "texlive2008" as a completion with a different path tail as a hidden } suffix. Fooling with this a bit more ... that loop looks like: for i in "$tmp1[@]"; do tmpdisp=("${i%%/*}") _list_files tmpdisp "$prepath$realpath$testpath" compadd "$tmp4[@]" -s "/${i#*/}" $listopts - "$tmpdisp" done If I change line 674 to this: tmpdisp=($i) then I get the same results with globcomplete set as without: torch% setopt globcomplete torch% print Tmp/texlive/t ^ cursor on this final slash However, I suspect using $i there is only working in this specific example and not in the general case. The resulting compadd looks like (line break added for readability): compadd -Qf -J -default- -J -default- -p Tmp/ -s '' -W Tmp/ \ -M 'r:|/=* r:|=*' -s /temp - texlive/temp (and similarly for all the other files in texlive and texlive2008). That looks wrong to me in any case because the description of -W indicates that it's used "together with" -p ... but also note that we have two -s options, so something is rotten in tmp4 at line 668, is it not? (However, in the NO_globcomplete case, the compadd still has identical arguments to the -p and -W options, so maybe that's a red herring and/or the -W doc is imprecise.)