zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: matching in the new completion system
Date: Tue, 13 Apr 1999 15:18:50 +0200 (MET DST)	[thread overview]
Message-ID: <199904131318.PAA04262@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Peter Stephenson's message of Tue, 13 Apr 1999 14:35:20 +0200


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<TAB>
> itsrm2% l /usr/s<TAB>
> 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/<TAB>, the whole
> shell hangs completely and has to be killed from somewhere else.  (I just
> started off with /u/s/m<TAB>, 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/<TAB>'). 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


             reply	other threads:[~1999-04-13 13:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-13 13:18 Sven Wischnowsky [this message]
1999-04-13 14:39 ` Peter Stephenson
1999-04-14  6:15   ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
1999-04-28  7:44 Sven Wischnowsky
1999-04-26 13:39 Sven Wischnowsky
1999-04-26 13:25 ` Peter Stephenson
1999-04-28  4:37 ` Bart Schaefer
1999-04-14  8:31 Sven Wischnowsky
1999-04-14  6:19 Sven Wischnowsky
1999-04-14  7:50 ` Peter Stephenson
1999-04-13 10:39 Sven Wischnowsky
1999-04-12  9:07 Sven Wischnowsky
1999-04-13  9:56 ` Andrej Borsenkow
1999-04-13 12:46 ` Andrej Borsenkow
1999-04-13 12:35   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199904131318.PAA04262@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).