From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10790 invoked from network); 6 Jan 2000 09:38:42 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jan 2000 09:38:42 -0000 Received: (qmail 17176 invoked by alias); 6 Jan 2000 09:38:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9237 Received: (qmail 17169 invoked from network); 6 Jan 2000 09:38:36 -0000 Date: Thu, 6 Jan 2000 10:38:34 +0100 (MET) Message-Id: <200001060938.KAA17703@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 06 Jan 2000 17:04:47 +0900 Subject: Re: completion with prefix which contains meta character. Tanaka Akira wrote: > I tried to complete with prefix `*' but zsh doesn't work well. > > Z(2):akr@is27e1u11% Src/zsh -f > is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst > is27e1u11% _tst () { compadd -P '*' xxx } > is27e1u11% tst \* > > This doesn't complete anything. > > is27e1u11% _tst () { compadd -P '\*' xxx } > is27e1u11% tst \* > > This doesn't complete anything too. But it should. At least I wanted to get the -P and -S be used literally (should be the most powerful, right?). Since I feel adventurous today, I even documented that. And that rembslash() didn't make any sense at all. Bye Sven diff -ru ../z.old/Doc/Zsh/compwid.yo Doc/Zsh/compwid.yo --- ../z.old/Doc/Zsh/compwid.yo Thu Jan 6 10:27:21 2000 +++ Doc/Zsh/compwid.yo Thu Jan 6 10:37:22 2000 @@ -420,7 +420,8 @@ startitem() item(tt(-P) var(prefix))( This gives a string to be inserted before the given var(words). The -string given is not considered as part of the match. +string given is not considered as part of the match and any shell +metacharacters in it will not be quoted when the string is inserted. ) item(tt(-S) var(suffix))( Like tt(-P) but gives a string to be inserted after the match. diff -ru ../z.old/Src/Zle/compcore.c Src/Zle/compcore.c --- ../z.old/Src/Zle/compcore.c Thu Jan 6 10:27:14 2000 +++ Src/Zle/compcore.c Thu Jan 6 10:32:46 2000 @@ -1629,9 +1629,7 @@ llsl = strlen(lsuf); /* Test if there is an existing -P prefix. */ if (dat->pre && *dat->pre) { - char *dp = rembslash(dat->pre); - - pl = pfxlen(dp, lpre); + pl = pfxlen(dat->pre, lpre); llpl -= pl; lpre += pl; } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de