From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20512 invoked from network); 21 Jan 1999 12:05:08 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 21 Jan 1999 12:05:08 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id HAA25270; Thu, 21 Jan 1999 07:03:16 -0500 (EST) Resent-Date: Thu, 21 Jan 1999 07:03:16 -0500 (EST) Date: Thu, 21 Jan 1999 13:02:08 +0100 (MET) Message-Id: <199901211202.NAA19795@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu Subject: Re: experimental new style completion Resent-Message-ID: <"VT9zX3.0.nA6.4Unfs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4943 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Here is another little fixlet for the new style completion stuff. The tokenizing in comp_str() failed for `$'s. Not wanting to change tokenize() itself I added a little wrapper function in zle_tricky.c (is there really no better way?). Bye Sven *** Src/Zle/zle_tricky.c.old Thu Jan 21 12:59:33 1999 --- Src/Zle/zle_tricky.c Thu Jan 21 12:58:27 1999 *************** *** 3348,3353 **** --- 3348,3379 ---- return 1; } + /* 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 == '$') { + if (bslash) + p[-1] = Bnull; + else + *p = String; + } + bslash = 0; + } + } + return r; + } + /**/ char * comp_str(int *ipl, int *pl) *************** *** 3358,3368 **** char *str; int lp, ls, lip; ! tokenize(p); remnulargs(p); ! tokenize(s); remnulargs(s); ! tokenize(ip); remnulargs(ip); ls = strlen(s); lip = strlen(ip); --- 3384,3394 ---- char *str; int lp, ls, lip; ! ctokenize(p); remnulargs(p); ! ctokenize(s); remnulargs(s); ! ctokenize(ip); remnulargs(ip); ls = strlen(s); lip = strlen(ip); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de