From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8246 invoked from network); 21 Feb 2009 19:16:42 -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=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; 21 Feb 2009 19:16:42 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 54150 invoked from network); 21 Feb 2009 19:16:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Feb 2009 19:16:37 -0000 Received: (qmail 22172 invoked by alias); 21 Feb 2009 19:16:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26591 Received: (qmail 22155 invoked from network); 21 Feb 2009 19:16:32 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 21 Feb 2009 19:16:32 -0000 Received: from vms173001pub.verizon.net (vms173001pub.verizon.net [206.46.173.1]) by bifrost.dotsrc.org (Postfix) with ESMTP id 5804D802720F for ; Sat, 21 Feb 2009 20:16:27 +0100 (CET) Received: from torch.brasslantern.com ([173.67.122.60]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KFF007JPK7EUMHY@vms173001.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 21 Feb 2009 13:16:27 -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 n1LJGPgH012909 for ; Sat, 21 Feb 2009 11:16:25 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n1LJGOFe012908 for zsh-workers@sunsite.dk; Sat, 21 Feb 2009 11:16:24 -0800 From: Bart Schaefer Message-id: <090221111624.ZM12907@torch.brasslantern.com> Date: Sat, 21 Feb 2009 11:16:23 -0800 In-reply-to: Comments: In reply to ( Text in unknown character set UTF-8 not shown ) Sommer "globcomplete desctroys file completion" (Feb 21, 2:18pm) References: 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/9019/Sat Feb 21 06:23:37 2009 on bifrost X-Virus-Status: Clean On Feb 21, 2:18pm, Jorg wrote: } } when I set the option globcomplete, file completion doesn't work in all } cases. Based just on the _complete_debug output you sent, I'd say that the correct thing is happening WITH globcomplete, and without it you're somehow getting disambiguation that you shouldn't. For example, T*/t*/t* should among other files match Tmp/texlive/tlpkg and Tmp/texlive2008/tlpkg, but when you complete without globcomplete you're offered Tmp/texlive/te as a unique prefix. How can that be correct? } % zsh -f } ibook% autoload -Uz compinit } ibook% compinit You might try using "compinit -D" here when testing, to avoid reading an existing zcompdump file. Probably doesn't matter here. } ibook% print -l T/t/t --> Tmp/texlive/te } ibook% setopt globcomplete } ibook% print -l T/t/t --> nothing, failure } % zsh --version } zsh 4.3.9 (powerpc-unknown-linux-gnu) } } A log for this is available at } http://alioth.debian.org/~jo-guest/zsh5117print1 What is helpful in these cases is TWO logs, e.g. one with globcomplete set and the other with globcomplete NOT set, for comparison. I created the set of files shown at _path_files:449 in your debug trace: schaefer<513> print -C 2 T*/t*/t* Tmp/texlive2008/texmf Tmp/texlive/texmf Tmp/texlive2008/texmf-dist Tmp/texlive/texmf.cnf Tmp/texlive2008/texmf-doc Tmp/texlive/texmf-config Tmp/texlive2008/texmf-var Tmp/texlive/texmf-dist Tmp/texlive2008/tlpkg Tmp/texlive/texmf-doc Tmp/texlive2008/tl-portable Tmp/texlive/texmf-local Tmp/texlive2008/tl-portable.bat Tmp/texlive/texmf-var Tmp/texlive/temp Tmp/texlive/tlpkg schaefer<514> zsh -f torch% autoload -Uz compinit torch% compinit -D torch% print T/t/t torch% print Tmp/texlive/t ^ cursor is here, on the slash, because texlive is ambiguous with texlive2008 torch% setopt globcomplete torch% print T/t/t Trace output left in /tmp/zsh12830print2 (up-history to view) torch% print T/t/t texlive/ texlive2008/ 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. When we finally get to the end of _path_files at line 813, $compstate[nmatches] is greater than zero so _path_files returns 1. I'm not sure why an empty $compstate[pattern_match] means that the function should behave as if NOT inserting the match into the command line (see comments around lines 627 and 666), but that's what causes the "correct" branch at 621-623. It also seems to be the case that xtrace output is omitting short-circuited branches of conditionals when printing, which makes it hard to follow the and/or logic in the trace. --