From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7655 invoked from network); 16 Feb 2000 16:42:16 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Feb 2000 16:42:16 -0000 Received: (qmail 2724 invoked by alias); 16 Feb 2000 16:42:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9765 Received: (qmail 2716 invoked from network); 16 Feb 2000 16:42:03 -0000 Date: Wed, 16 Feb 2000 17:42:02 +0100 (MET) Message-Id: <200002161642.RAA20227@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Peter Stephenson's message of Tue, 15 Feb 2000 21:58:59 +0000 Subject: Re: PATCH: _sep_parts Peter Stephenson wrote: > There seems to be a typo in _sep_parts, which I was trying out for the > guide. > > By the way, there also seems to be a problem if one of the separators > contains a character that needs quoting: completion quotes it, but > _sep_parts doesn't recognise the quoted string as being the separator when > performing later completions --- there's no use quoting it by hand, since > it gets requoted. Maybe there's an easy workaround, else judicious use of > -Q may be required, which _sep_parts doesn't accept. Not that I have an > application for this, anyway. This should fix it. Bye Sven P.S.: Does it have `Don't panic' on its back? diff -ru ../z.old/Completion/Core/_sep_parts Completion/Core/_sep_parts --- ../z.old/Completion/Core/_sep_parts Wed Feb 16 12:40:34 2000 +++ Completion/Core/_sep_parts Wed Feb 16 17:40:11 2000 @@ -57,7 +57,7 @@ # Get the matching array elements. - PREFIX="${str%%${sep}*}" + PREFIX="${str%%(|\\)${sep}*}" builtin compadd -O testarr - "${(@P)arr}" [[ $#testarr -eq 0 && -n "$_comp_correct" ]] && compadd -O testarr - "${(@P)arr}" @@ -129,7 +129,7 @@ [[ $#tmparr -eq 0 && -n "$_comp_correct" ]] && compadd -O tmparr - "${(@P)arr}" - suffixes=("${(@)^suffixes[@]}${1}${(@)^tmparr}") + suffixes=("${(@)^suffixes[@]}${(q)1}${(@)^tmparr}") # We want the completion code to generate the most specific suffix # for us, so we collect matching specifications that allow partial @@ -142,7 +142,7 @@ # If we were given at least one more separator we make the completion # code offer it by appending it as a autoremovable suffix. -(( $# )) && autosuffix=(-qS "$1") +(( $# )) && autosuffix=(-qS "${(q)1}") # If we have collected matching specifications, we build an array # from it that can be used as arguments to `compadd'. -- Sven Wischnowsky wischnow@informatik.hu-berlin.de