From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 849 invoked from network); 10 Jul 2009 09:14:59 -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.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 10 Jul 2009 09:14:59 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 8145 invoked from network); 10 Jul 2009 09:07:36 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Jul 2009 09:07:36 -0000 Received: (qmail 5665 invoked by alias); 10 Jul 2009 09:07:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27121 Received: (qmail 5647 invoked from network); 10 Jul 2009 09:07:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 10 Jul 2009 09:07:28 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 447DB80307FA for ; Fri, 10 Jul 2009 11:07:25 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly24d.srv.mailcontrol.com (MailControl) with ESMTP id n6A97281026662 for ; Fri, 10 Jul 2009 10:07:24 +0100 Received: from news01 ([10.99.50.25]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Fri, 10 Jul 2009 10:07:22 +0100 Date: Fri, 10 Jul 2009 10:07:21 +0100 From: Peter Stephenson To: Zsh list Subject: Re: file completion of ~user/... stats wrong directory Message-ID: <20090710100721.56b0874c@news01> In-Reply-To: <19030.11925.370937.608524@gargle.gargle.HOWL> References: <19030.11925.370937.608524@gargle.gargle.HOWL> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Jul 2009 09:07:22.0015 (UTC) FILETIME=[D5818AF0:01CA013D] X-Scanned-By: MailControl A-09-20-00 (www.mailcontrol.com) on 10.68.0.134 X-Virus-Scanned: ClamAV 0.94.2/9551/Thu Jul 9 15:22:08 2009 on bifrost X-Virus-Status: Clean On Thu, 9 Jul 2009 13:53:25 -0400 Greg Klanderman wrote: > Looking at _path_files, I'm guessing it has something to do with > setting prepaths=( '' ) in the logic dealing with ~ prefixed strings. > But I don't understand what prepaths is supposed to be doing. It > worries me a bit that it is set to that same value in a number of > other cases. Maybe it should be setting prepaths=() instead? prepaths comes from the -W option (see the zparseopts call), which is used when you want the file matcher to behave as if there was a path prefix---for example, to complete folders in your mail directory, you might use "-W ~/Mail". I think the reason it's not an empty array is that matches are eventually generated in a loop over all -W paths. If there are none, we still want to execute that loop once, but with an empty prepath (at line 340): for prepath in "$prepaths[@]"; do -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070