From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28338 invoked from network); 9 Mar 1999 13:47:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Mar 1999 13:47:59 -0000 Received: (qmail 19429 invoked by alias); 9 Mar 1999 13:47:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5707 Received: (qmail 19421 invoked from network); 9 Mar 1999 13:47:39 -0000 Date: Tue, 9 Mar 1999 14:46:50 +0100 (MET) Message-Id: <199903091346.OAA14476@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Tue, 9 Mar 1999 15:15:34 +0300 Subject: PATCH: Re: _path_files and variables Andrej Borsenkow wrote: > bor@itsrm2:~%> cd /tools/bin > bor@itsrm2:/tools/bin%> l ${PWD}/z > Beep > > but > > bor@itsrm2:/tools/bin%> zsh -f > itsrm2% l ${PWD}/z > zip* zipinfo* zsh* zsh-3.1.5-pws-8* > zipcloak* zipnote* zsh-3.1.5-pws-10* zsh-3.1.5-pws-9* > zipgrep* zipsplit* zsh-3.1.5-pws-11* zsh.old* > > I quite often used completion at least with $PWD I removed this when adding the `parameter' context -- too happy to remove `ctokenize()'. But, yes, maybe we should put (a slightly simplified version of) it back, to get this to work again. > And I suspect, that the following will break (sigh ...): > > ${PWD/foo/bar}/TAB > > not that I expect it to be used so often :-) But that always worked (with old completion, and with the patch below with new completion, too, again)... Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Tue Mar 9 11:33:29 1999 +++ Src/Zle/zle_tricky.c Tue Mar 9 14:43:43 1999 @@ -5430,6 +5430,32 @@ /* This should probably be moved into tokenize(). */ /**/ +static char * +ctokenize(char *p) +{ + char *r = p; + int bslash = 0; + + tokenize(p); + + for (p = r; *p; p++) { + if (*p == '\\') + bslash = 1; + else { + if (*p == '$' || *p == '=' || *p == '{' || *p == '}') { + if (bslash) + p[-1] = Bnull; + else + *p = (*p == '$' ? String : + (*p == '{' ? Inbrace : Outbrace)); + } + bslash = 0; + } + } + return r; +} + +/**/ char * comp_str(int *ipl, int *pl, int untok) { @@ -5440,11 +5466,11 @@ int lp, ls, lip; if (!untok) { - tokenize(p); + ctokenize(p); remnulargs(p); - tokenize(s); + ctokenize(s); remnulargs(s); - tokenize(ip); + ctokenize(ip); remnulargs(ip); } ls = strlen(s); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de