From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12284 invoked from network); 12 Feb 2003 15:06:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Feb 2003 15:06:46 -0000 Received: (qmail 7086 invoked by alias); 12 Feb 2003 15:06:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18230 Received: (qmail 7076 invoked from network); 12 Feb 2003 15:06:34 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Feb 2003 15:06:34 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.183.235] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Feb 2003 15:6:34 -0000 Received: from exchange01.csr.com (unverified) by (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Wed, 12 Feb 2003 15:13:11 +0000 Received: from csr.com (tinky-winky.csr.com [192.168.144.127]) by exchange01.csr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id DQ47MLRP; Wed, 12 Feb 2003 15:07:12 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: _path_files prefix handling In-reply-to: "Peter Stephenson"'s message of "Wed, 12 Feb 2003 12:29:10 GMT." <19754.1045052950@csr.com> Date: Wed, 12 Feb 2003 15:06:35 +0000 Message-ID: <13889.1045062395@csr.com> From: Peter Stephenson Peter Stephenson wrote: > 1. At the least we could test [[ -d pathcomponent ]] at each stage and > trust the system to get this right, rather than rely on pathcomponent > appearing in the list of entries in the current directory. This ought > to be relatively simple, and I think fixes all the problems I know about > --- this test works for all components of /cygdrive/c/Program\ Files > under Cygwin, for example, making half of `fake's properties redundant > (you still need it to be offered the choice, but don't need it for the > system to recognise that the choice is a valid path component). Here's an attempt which seems to do more or less the right thing with Cygwin and ClearCase without fake-files. I'm not claiming this is The Right Way To Do It. I have tried it with a filename with a space in, however. Index: Completion/Unix/Type/_path_files =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v retrieving revision 1.20 diff -u -r1.20 _path_files --- Completion/Unix/Type/_path_files 6 Nov 2002 08:03:44 -0000 1.20 +++ Completion/Unix/Type/_path_files 12 Feb 2003 15:05:06 -0000 @@ -343,6 +343,22 @@ if [[ -n "$PREFIX$SUFFIX" ]]; then # See which of them match what's on the line. + # pws non-canonical hack which seems to work so far... + # if we didn't match by globbing, check that there is + # something to match by explicit name. This is for + # `clever' filing systems where names pop into existence + # when referenced. + if (( ! $#tmp1 )); then + for tmp3 in "$tmp2[@]"; do + if [[ -n $tmp3 && $tmp3 != */ ]]; then + tmp3+=/ + fi + if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then + tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}") + fi + done + fi + if (( ! $#tmp1 )); then tmp2=( ${^tmp2}/$PREFIX$SUFFIX ) elif [[ "$tmp1[1]" = */* ]]; then -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************