From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7645 invoked from network); 25 Aug 2008 16:48:46 -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; 25 Aug 2008 16:48:46 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 37550 invoked from network); 25 Aug 2008 16:48:21 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Aug 2008 16:48:21 -0000 Received: (qmail 3236 invoked by alias); 25 Aug 2008 16:48:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25530 Received: (qmail 3218 invoked from network); 25 Aug 2008 16:48:05 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Aug 2008 16:48:05 -0000 Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bifrost.dotsrc.org (Postfix) with ESMTP id E315F8030847 for ; Mon, 25 Aug 2008 18:47:59 +0200 (CEST) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080825164759.DXTP777.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Mon, 25 Aug 2008 17:47:59 +0100 Received: from pws-pc ([81.107.43.40]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20080825164759.NSBK5827.aamtaout01-winn.ispmail.ntl.com@pws-pc> for ; Mon, 25 Aug 2008 17:47:59 +0100 Date: Mon, 25 Aug 2008 17:47:51 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: "pws non-canonical hack" problems Message-ID: <20080825174751.38323d18@pws-pc> In-Reply-To: <080823075551.ZM5496@torch.brasslantern.com> References: <20080823072446.GM8612@altlinux.org> <080823075551.ZM5496@torch.brasslantern.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/8086/Mon Aug 25 14:20:55 2008 on bifrost X-Virus-Status: Clean On Sat, 23 Aug 2008 07:55:49 -0700 Bart Schaefer wrote: > On Aug 23, 11:24am, Alexey I. Froloff wrote: > } > } _path_files: > } 377 # pws non-canonical hack which seems to work so far... > } 378 # if we didn't match by globbing, check that there is > } 379 # something to match by explicit name. This is for > } 380 # `clever' filing systems where names pop into existence > } 381 # when referenced. > } 382 if (( ! $#tmp1 )); then > } 383 for tmp3 in "$tmp2[@]"; do > } 384 if [[ -n $tmp3 && $tmp3 != */ ]]; then > } 385 tmp3+=/ > } 386 fi > } 387 if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then > } 388 tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}") > } 389 fi > } 390 done > } 391 fi > } > } When I completing directory, sometimes file is being completed. > > The problem is that this code should not unconditionally append something > to tmp1. It has to test again (probably by using some variant of the call > to compfiles that appears 20 or so lines above) that some new file really > was created that matches the qualifiers in the generated glob pattern. Er, isn't that what the -e test does? What I think you mean is there may be options to compfiles that don't get taken account of at this point. Unfortunately, the file completion code was never very intelligible and there are way too many cases. If anyone can come up with a way of limiting this test in the right way, great. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/