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

Re: completion with prefix which contains meta character.



Tanaka Akira wrote:

> In article <200001060938.KAA17703@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>   Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > But it should. At least I wanted to get the -P and -S be used
> > literally (should be the most powerful, right?).
> 
> I agree. It's the most powerful way.
> 
> > Since I feel adventurous today, I even documented that.
> > 
> > And that rembslash() didn't make any sense at all.
> 
> Thanks.  Now compadd -P is useful even in these cases.  But I found
> similar problem about compset -P.
> 
> Z:akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% _tst () { compset -P '\*' && compadd xxx } 
> is27e1u11% tst \*<TAB>
> 
> This completes nothing.
> 
> is27e1u11% _tst () { compset -P '\\\*' && compadd xxx }   
> is27e1u11% tst \*<TAB>
> 
> This completes nothing, too.
> 
> If compset -P tries to match against unquoted form of prefix, former
> should complete xxx.  If it tries to match against quoted form, latter
> should complete xxx.  But both completes nothing.

Yup. Since $PREFIX contains the quoted form, compset should use it, too.

Thanks.

Bye
 Sven

diff -ru ../z.old/Src/Zle/complete.c Src/Zle/complete.c
--- ../z.old/Src/Zle/complete.c	Thu Jan  6 13:52:33 2000
+++ Src/Zle/complete.c	Thu Jan  6 15:59:48 2000
@@ -894,11 +894,9 @@
 	break;
     case CVT_RANGEPAT:
 	tokenize(sa);
-	sa = rembslash(sa);
 	remnulargs(sa);
 	if (sb) {
 	    tokenize(sb);
-	    sb = rembslash(sb);
 	    remnulargs(sb);
 	}
 	break;
@@ -914,7 +912,6 @@
 	} else
 	    na = -1;
 	tokenize(sa);
-	sa = rembslash(sa);
 	remnulargs(sa);
 	break;
     }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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