From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13280 invoked from network); 13 Apr 1999 13:39:11 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Apr 1999 13:39:11 -0000 Received: (qmail 19015 invoked by alias); 13 Apr 1999 13:19:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6021 Received: (qmail 19008 invoked from network); 13 Apr 1999 13:19:00 -0000 Date: Tue, 13 Apr 1999 15:18:50 +0200 (MET DST) Message-Id: <199904131318.PAA04262@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Tue, 13 Apr 1999 14:35:20 +0200 Subject: Re: PATCH: matching in the new completion system Andrej Borsenkow wrote: > (implying /usr/share/man/mrd) > > bor@itsrm2:/tools/src/zsh-3.1.5-pws-14/Completion%> zsh -f > itsrm2% fpath=(*(/)) > itsrm2% source Core/compinit > bor@itsrm2:~%> l /u/s/m/m > itsrm2% l /usr/s > itsrm2% l /usr/s > sadm/ sbin/ share/ spool@ src/ sysadm/ Certainly not intentional. I forgot to make sure that `compadd' knows that the strings contain parts separated by slashes. Peter Stephenson wrote: > It gets worse after that. If I now go back and do /u/s/, the whole > shell hangs completely and has to be killed from somewhere else. (I just > started off with /u/s/m, but it all looks similar.) Ick. I can't reproduce this, but... Are you sure it hangs? Or is it just incredibly slow? For me, the lack of speed comes from the size of the directories `/usr/s*'. Also, there was a problem with building a pattern that is used to remove unmatched strings over which I stumbled when trying the same (`/u/s/'). The problem was that I used `${(@M)tmp1:#(${(j:|:)~tmp2})}' where I should have used `${(@M)tmp1:#(${(j:|:)~${(@)tmp2:q}})}' to make sure special characters in the filenames are not taken as pattern characters. Still, I would like to know where it got stuck. Bye Sven diff -u oc/Core/_path_files Completion/Core/_path_files --- oc/Core/_path_files Tue Apr 13 15:10:30 1999 +++ Completion/Core/_path_files Tue Apr 13 15:09:19 1999 @@ -214,9 +214,9 @@ # Remove all files that weren't matched. if [[ "$tmp1[1]" = */* ]]; then - tmp1=( "${(@M)tmp1:#*/(${(j:|:)~tmp2})}" ) + tmp1=( "${(@M)tmp1:#*/(${(j:|:)~${(@)tmp2:q}})}" ) else - tmp1=( "${(@M)tmp1:#(${(j:|:)~tmp2})}" ) + tmp1=( "${(@M)tmp1:#(${(j:|:)~${(@)tmp2:q}})}" ) fi # Step over to the next component, if any. @@ -290,7 +290,7 @@ for i in "$tmp1[@]"; do compadd -Uf -p "$linepath$testpath" -s "/${i#*/}" \ -W "$prepath$realpath$testpath" "$ignore[@]" \ - "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" \ + "$addpfx[@]" "$addsfx[@]" "$remsfx[@]" -M 'r:|/=* r:|=*' \ "$group[@]" "$expl[@]" -i "$IPREFIX" -I "$ISUFFIX" \ - "${i%%/*}" done -- Sven Wischnowsky wischnow@informatik.hu-berlin.de