From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20503 invoked from network); 23 Apr 2004 16:23:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Apr 2004 16:23:17 -0000 Received: (qmail 355 invoked by alias); 23 Apr 2004 16:23:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19825 Received: (qmail 327 invoked from network); 23 Apr 2004 16:23:10 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Apr 2004 16:23:10 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 23 Apr 2004 16:23:10 -0000 Received: (qmail 14655 invoked from network); 23 Apr 2004 16:23:10 -0000 Received: from lhuumrelay3.lnd.ops.eu.uu.net (62.189.58.19) by a.mx.sunsite.dk with SMTP; 23 Apr 2004 16:23:07 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i3NGMfv04229 for ; Fri, 23 Apr 2004 16:22:41 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id ; Fri, 23 Apr 2004 17:22:13 +0100 Received: from csr.com ([192.168.144.127]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 23 Apr 2004 17:23:29 +0100 To: Michael Denio cc: zsh-workers@sunsite.dk Subject: Re: _perforce completer In-reply-to: "Michael Denio"'s message of "Fri, 23 Apr 2004 12:03:20 EDT." <40893E48.1010609@morganstanley.com> Date: Fri, 23 Apr 2004 17:22:40 +0100 Message-ID: <5596.1082737360@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 23 Apr 2004 16:23:29.0069 (UTC) FILETIME=[4FC51DD0:01C4294F] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Michael Denio wrote: > > Note that it should use styles to be sufficiently general. Something > > similar to the jobview style would be appropriate: > > It does. Here is my zstyle line from .zshrc > > zstyle ':completion:*:changes' current_user true > > I user the value of $USER thinking it was more appropriate. If you like > I could change it so the user name has to be specified. This is perfectly workable, but on the whole I'm inclined to prefer my proposal to avoid accumulating ever new arguments. Now you need to do: zstyle ':completion:*:changes' changes -u $USER Is this OK? Index: Completion/Unix/Command/_perforce =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perforce,v retrieving revision 1.18 diff -u -r1.18 _perforce --- Completion/Unix/Command/_perforce 11 Nov 2003 10:35:55 -0000 1.18 +++ Completion/Unix/Command/_perforce 23 Apr 2004 16:21:09 -0000 @@ -47,6 +47,12 @@ # p4 jobs -e 'user=pws' # i.e. those assigned to Perforce user `pws'. # +# Completion of changes can be controlled by the `changes' style. +# This takes additional arguments to be passed to `p4 changes'. +# An obvious example is: +# zstyle ':completion:*:p4-*:changes' changes -u $USER +# to limit changes to the present user. +# # The style `all-files' is used to tell the completion system to # complete any file in a given context. This is for use in places # where it would, for example, only complete files opened for editing. @@ -495,9 +501,10 @@ (( $+functions[_perforce_changes] )) || _perforce_changes() { local cline match mbegin mend max ctype num comma file - local -a cl cstatus amax + local -a cl cstatus amax xargs zstyle -s ":completion:${curcontext}:changes" max max || max=20 + zstyle -a ":completion:${curcontext}:changes" changes xargs if [[ ${NUMERIC:-0} -lt 0 && -z $compstate[insert] ]]; then # Not inserting (i.e. just listing) and given a negative # prefix argument. Instead of listing possible completions, @@ -548,7 +555,7 @@ # Limit to the 20 most recent changes by default to avoid huge # output. cl=( -${${${${(f)"$(_perforce_call_p4 changes changes $amax $cstatus \$file)"}##Change\ }//\ on\ /:}/\ by\ /\ } +${${${${(f)"$(_perforce_call_p4 changes changes $amax $xargs $cstatus \$file)"}##Change\ }//\ on\ /:}/\ by\ /\ } "default:change not yet numbered") [[ $#cl -eq 1 && $cl[1] = '' ]] && cl=() _describe -t changes "${ctype}change" cl -V changes-unsorted $comma -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************