From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1489 invoked from network); 12 Mar 1999 09:36:47 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Mar 1999 09:36:47 -0000 Received: (qmail 11116 invoked by alias); 12 Mar 1999 09:36:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5770 Received: (qmail 11100 invoked from network); 12 Mar 1999 09:36:21 -0000 Date: Fri, 12 Mar 1999 10:36:18 +0100 (MET) Message-Id: <199903120936.KAA02982@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Thu, 11 Mar 1999 18:02:19 +0100 Subject: Re: completion features Peter Stephenson wrote: > 1. > _path_files won't handle path-expansion after directories in the stack, > e.g. ~1/f/b won't go to ~1/foo/bar (even if that exists). Sometimes it > tries to quote the ~ on the command line, which doesn't stop it doing > normal completion (even though technically that's now a literal tilde), but > doesn't help it do multipath completion. About the completion after things like `~1/': this works for me, at least after the patch to `_pth_files' I sent in reply to Andrej. Also, the patch below should make the treatment of quoted/unquoted metacharacters more consistent. (I just hate the interaction of completion and quoting...). Hm, Peter, could you try it again? Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Thu Mar 11 17:22:37 1999 +++ Src/Zle/zle_tricky.c Fri Mar 12 10:27:38 1999 @@ -894,21 +894,23 @@ * change the command line, do completion. */ if (olst == COMP_EXPAND_COMPLETE && !strcmp(ol, (char *)line)) { - char *p; - cs = ocs; errflag = 0; - p = s; - if (*p == Tilde || *p == Equals) - p++; - for (; *p; p++) - if (itok(*p)) { - if (*p != String && *p != Qstring) - *p = ztokens[*p - Pound]; - else if (p[1] == Inbrace) - p++, skipparens(Inbrace, Outbrace, &p); - } + if (!compfunc) { + char *p; + + p = s; + if (*p == Tilde || *p == Equals) + p++; + for (; *p; p++) + if (itok(*p)) { + if (*p != String && *p != Qstring) + *p = ztokens[*p - Pound]; + else if (p[1] == Inbrace) + p++, skipparens(Inbrace, Outbrace, &p); + } + } docompletion(s, lst, lincmd); } } else @@ -5233,19 +5235,23 @@ compquote = ztrdup(""); compquoting = ztrdup(""); } - untokenize(s = dupstring(s)); zsfree(compprefix); zsfree(compsuffix); if (unset(COMPLETEINWORD)) { - compprefix = ztrdup(s); + tmp = quotename(s, NULL, NULL, NULL); + untokenize(tmp); + compprefix = ztrdup(tmp); compsuffix = ztrdup(""); } else { char *ss = s + offs, sav; - + + tmp = quotename(s, &ss, NULL, NULL); sav = *ss; *ss = '\0'; - compprefix = ztrdup(s); + untokenize(tmp); + compprefix = ztrdup(tmp); *ss = sav; + untokenize(ss); compsuffix = ztrdup(ss); } zsfree(compiprefix); -- Sven Wischnowsky wischnow@informatik.hu-berlin.de