Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Fun with new completion



Andrej Borsenkow wrote:

> I have /archive/pub/unix/sudo/ with cu-sudo* files in it. I forgot, that
> they are prefixed with cu- and did
> 
> gzcat /a/p/u/s/s<TAB>
> 
> with the nice result
> 
> gzcat //a
> 
> Plain old multicomp just beeps and leaves the string as is. Now, it is
> _really_ hard to decide what to do ... Should it complete as far as
> possible? Or, if nothing matches, leave command line as is? Again, the
> problem is, zsh cannot read your mind and decide, where was the error.

At least it shouldn't give what it gives now... this was something
that looked good for the things I tried it with but sometimes...

The patch below makes it leave the line unchanged. A probably better
solution would have a second loop over the `-W' paths to try to expand 
as much of the path as possible. Hm, I /think/ that would be better...

Bye
 Sven

P.S.: The senders in the summary of my mail reader look like a party
      of ping-pong between Andrej and me...

diff -u oc/Core/_path_files Completion/Core/_path_files
--- oc/Core/_path_files	Tue Mar  9 15:31:15 1999
+++ Completion/Core/_path_files	Tue Mar  9 15:46:06 1999
@@ -261,9 +261,6 @@
       # next `-W' path.
 
       if [[ $#collect -eq 0 ]]; then
-        compadd -QU "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" \
-                -i "$IPREFIX" -p "${linepath:q}${testpath:q}" -S "/${ostr#*/}" \
-		-W "$tmp1" -f "$ignore[@]" - "${(@)tmp1:q}"
         continue 2
       elif [[ $#collect -ne 1 ]]; then
         # If we have more than one possible match, this means that the

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author