From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24914 invoked by alias); 31 Oct 2011 19:34:55 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16550 Received: (qmail 21327 invoked from network); 31 Oct 2011 19:34:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZqubH+eddJqKulxsJ3SYj6sBiZhQ2q5aIk0+mAjvOE4=; b=bH1Ddma3uSPOQu3+MLyaw9ozR7atXNA7DoEsDyPy6R8YGAmQSBZN3YbEmZrnWsI0CM xe5pNZdikwAWQ81LFufMEWHzVZ+6dY11RVhb4pF1nXreCkRXJ0q5dshWtNNwF4n2q2gX +JXzfXqkC1RtxFPZaTQJbR3cmPHNKGpl+Him0= MIME-Version: 1.0 In-Reply-To: <20111029193001.4c0dd8e4@pws-pc.ntlworld.com> References: <20111029193001.4c0dd8e4@pws-pc.ntlworld.com> Date: Mon, 31 Oct 2011 12:34:36 -0700 Message-ID: Subject: Re: Completing arguments containing the colon character From: Gabor Maghera To: Peter Stephenson Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=e89a8f646a4f3c144b04b09d541f --e89a8f646a4f3c144b04b09d541f Content-Type: text/plain; charset=UTF-8 Thank you, Peter. I grabbed the latest revision from SourceForge. It works like a charm. Cheers, Gabor On Sat, Oct 29, 2011 at 11:30 AM, Peter Stephenson < p.w.stephenson@ntlworld.com> wrote: > On Fri, 28 Oct 2011 16:12:05 -0700 > Gabor Maghera wrote: > > We use a naming standard for Perforce specs of the form > > "::". Zsh autocompletion cannot process these > entries, > > due to the colon character being used as a list separator by its > mechanism > > (as I understand). > > Right, but the quoting convention is straightforward -- just apply a > backslash. The following should be good enough. I've tried to apply it > everywhere it could possibly make sense; it should be harmless if it's > not needed. Just possibly you might get some extra backslashes in > descriptive text, since I haven't attempted to separate that out. > > (By the way I don't usually post updates to _perforce since they aren't > of general interest, so it's often worth checking the archive.) > > Index: Completion/Unix/Command/_perforce > =================================================================== > RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perforce,v > retrieving revision 1.52 > diff -p -u -r1.52 _perforce > --- Completion/Unix/Command/_perforce 17 Oct 2011 17:00:49 -0000 > 1.52 > +++ Completion/Unix/Command/_perforce 29 Oct 2011 18:28:22 -0000 > @@ -603,7 +603,7 @@ _perforce_global_options() { > _perforce_branches() { > local bline match mbegin mend > local -a bl > - bl=(${${${(f)"$(_perforce_call_p4 branches branches > 2>/dev/null)"}##Branch }/ /:}) > + bl=(${${${${(f)"$(_perforce_call_p4 branches branches > 2>/dev/null)"}##Branch }//:/\\:}/ /:}) > [[ $#bl -eq 1 && $bl[1] = '' ]] && bl=() > (( $#bl )) && _describe -t branches 'Perforce branch' bl > } > @@ -685,7 +685,7 @@ awk '/^Client:/ { print $2 }')") > # Limit to the 20 most recent changes by default to avoid huge > # output. > cl=( > -${${${${(f)"$(_perforce_call_p4 changes changes $amax $xargs $cstatus > \$file)"}##Change\ }//\ on\ /:}/\ by\ /\ } > +${${${${${(f)"$(_perforce_call_p4 changes changes $amax $xargs $cstatus > \$file)"}##Change\ }//:/\\:}//\ on\ /:}/\ by\ /\ } > ) > # "default" can't have shelved files in it... > [[ $ctype = shelved* ]] || cl+=("default:change not yet numbered") > @@ -711,7 +711,7 @@ _perforce_clients() { > compset -P '//' && slash=(-S/ -q) > fi > > - cl=(${${${(f)"$(_perforce_call_p4 clients clients)"}##Client\ }/\ /:}) > + cl=(${${${${(f)"$(_perforce_call_p4 clients clients)"}##Client\ > }//:/\\:}/\ /:}) > [[ $#cl -eq 1 && $cl[1] = '' ]] && cl=() > _describe -t clients 'Perforce client' cl $slash > } > @@ -722,7 +722,7 @@ _perforce_counters() { > local cline match mbegin mend > local -a cl > > - cl=(${${${(f)"$(_perforce_call_p4 counters counters)"}/\ /:}/\=/current > value}) > + cl=(${${${${(f)"$(_perforce_call_p4 counters counters)"}//:/\\:}/\ > /:}/\=/current value}) > [[ $#cl -eq 1 && $cl[1] = '' ]] && cl=() > _describe -t counters 'Perforce counter' cl > } > @@ -796,7 +796,7 @@ _perforce_depots() { > local dline match mbegin mend > local -a dl > > - dl=(${${${(f)"$(_perforce_call_p4 depots depots)"}##Depot\ }/\ /:}) > + dl=(${${${${(f)"$(_perforce_call_p4 depots depots)"}##Depot\ > }//:/\\:}/\ /:}) > [[ $#dl -eq 1 && $dl[1] = '' ]] && dl=() > _describe -t depots 'depot name' dl > } > @@ -1594,7 +1594,7 @@ _perforce_submit_options() { > _perforce_pids() { > local -a ul > > - ul=(${${${(f)"$(_perforce_call_p4 monitor monitor show 2>/dev/null)"}# > *}/\ /:}) > + ul=(${${${${(f)"$(_perforce_call_p4 monitor monitor show > 2>/dev/null)"}# *}//:/\\:}/\ /:}) > [[ $#ul -eq 1 && $ul[1] = '' ]] && ul=() > _describe -t id 'process ID' ul > } > @@ -1604,7 +1604,7 @@ _perforce_pids() { > _perforce_users() { > local -a ul > > - ul=(${${(f)"$(_perforce_call_p4 users users)"}/\ /:}) > + ul=(${${${(f)"$(_perforce_call_p4 users users)"}//:/\\:}/\ /:}) > [[ $#ul -eq 1 && $ul[1] = '' ]] && ul=() > _describe -t users 'Perforce user' ul > } > > > -- > Peter Stephenson > Web page now at http://homepage.ntlworld.com/p.w.stephenson/ > > --e89a8f646a4f3c144b04b09d541f--