From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11243 invoked from network); 29 Jan 2009 16:27: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.5 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; 29 Jan 2009 16:27:05 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 47487 invoked from network); 29 Jan 2009 16:27:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Jan 2009 16:27:00 -0000 Received: (qmail 4540 invoked by alias); 29 Jan 2009 16:26:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26484 Received: (qmail 4526 invoked from network); 29 Jan 2009 16:26:56 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Jan 2009 16:26:56 -0000 Received: from vms173003pub.verizon.net (vms173003pub.verizon.net [206.46.173.3]) by bifrost.dotsrc.org (Postfix) with ESMTP id A33F680271F0 for ; Thu, 29 Jan 2009 17:26:53 +0100 (CET) Received: from torch.brasslantern.com ([96.238.220.215]) by vms173003.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KE800E7RQQ3WGG0@vms173003.mailsrvcs.net> for zsh-workers@sunsite.dk; Thu, 29 Jan 2009 10:20:32 -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 n0TGKQf6015911 for ; Thu, 29 Jan 2009 08:20:26 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n0TGKP8x015910 for zsh-workers@sunsite.dk; Thu, 29 Jan 2009 08:20:25 -0800 Date: Thu, 29 Jan 2009 08:20:25 -0800 From: Bart Schaefer Subject: Re: bug in accept-exact-dirs style In-reply-to: <18815.40644.128711.97121@gargle.gargle.HOWL> To: Zsh list Message-id: <090129082025.ZM15909@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <18815.40644.128711.97121@gargle.gargle.HOWL> Comments: In reply to Greg Klanderman "bug in accept-exact-dirs style" (Jan 27, 6:54pm) X-Virus-Scanned: ClamAV 0.92.1/8919/Thu Jan 29 14:05:38 2009 on bifrost X-Virus-Status: Clean On Jan 27, 6:54pm, Greg Klanderman wrote: } } [~] greg@lwm| zsh -f } lwm% mkdir foo } lwm% touch foo/bar } lwm% touch foo/baz } lwm% autoload -U compinit } lwm% compinit } lwm% zstyle ':completion:*' accept-exact-dirs yes } } Now try completing each of the following: } } ls foo/ # OK } ls ~/foo/ # doesn't work - no completions } ls /home/greg/foo/ # OK } ls $HOME/foo/ # doesn't work - no completions This isn't directly related to accept-exact-dirs ... a prefix that needs expansion is removed by _path_files in the section between the comments # Now let's have a closer look at the string to complete. and # Now we generate the matches. First we loop over all prefix paths given # with the `-W' option. The result after removing the prefix eventually ends up in $tmp1, so when that is a string that will still pass the -d test in this loop: while true; do if [[ -d $donepath$tmp1 ]]; then donepath=$donepath$tmp1/ pre=$tpre break elif [[ $tmp1 = (#b)(*)/([^/]#) ]]; then tmp1=$match[1] tpre=$match[2]/$tpre else break fi done Then the code is fooled into thinking that the suffix is part of the prefix, and on line 585 the PREFIX string is rebuilt in the wrong order, becoming "tmp/~/" instead of "~/tmp/". At that point I get lost, and I've already spent more time than I should have looking at it. PWS? Anyone?