From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19092 invoked from network); 23 Apr 2004 16:03:31 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Apr 2004 16:03:31 -0000 Received: (qmail 2857 invoked by alias); 23 Apr 2004 16:03:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19823 Received: (qmail 2846 invoked from network); 23 Apr 2004 16:03:23 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 23 Apr 2004 16:03:23 -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:3:23 -0000 Received: (qmail 5514 invoked from network); 23 Apr 2004 16:03:23 -0000 Received: from hqvsbh2.ms.com (205.228.12.104) by a.mx.sunsite.dk with SMTP; 23 Apr 2004 16:03:21 -0000 Received: from hqvsbh2.ms.com (localhost [127.0.0.1]) by localhost.ms.com (Postfix) with SMTP id 8C111526E; Fri, 23 Apr 2004 12:03:20 -0400 (EDT) Received: from ny37im01.ms.com (unknown [144.14.31.40]) by hqvsbh2.ms.com (internal Postfix) with ESMTP id 68297137C6; Fri, 23 Apr 2004 12:03:20 -0400 (EDT) Received: from morganstanley.com (dynamic-144-14-230-67 [144.14.230.67]) by ny37im01.ms.com (Sendmail MTA Hub) with ESMTP id i3NG3KX11686; Fri, 23 Apr 2004 12:03:20 -0400 (EDT) Message-ID: <40893E48.1010609@morganstanley.com> Date: Fri, 23 Apr 2004 12:03:20 -0400 From: Michael Denio Organization: Morgan Stanley User-Agent: Mozilla Thunderbird 0.5 (Windows/20040212) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Stephenson Cc: zsh-workers@sunsite.dk Subject: Re: _perforce completer References: <8137.1082735886@csr.com> In-Reply-To: <8137.1082735886@csr.com> Content-Type: multipart/mixed; boundary="------------070300070106020406090504" 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=BAYES_40 autolearn=no version=2.63 X-Spam-Hits: -0.0 --------------070300070106020406090504 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Peter Stephenson wrote: > Michael Denio wrote: > >>Hello, >> >>I made a change to the _perforce completer to optionally restrict the >>list of changes to only those owned by the current user. To whom should >>I send the patch? > > > zsh-workers. I've attached the patch > > 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. -- Michael Denio (Michael.Denio@morganstanley.com) Equity Trading Infrastructure --------------070300070106020406090504 Content-Type: text/plain; name="_perforce.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="_perforce.patch" --- _perforce.orig Fri Apr 23 11:53:07 2004 +++ _perforce Fri Apr 23 11:23:14 2004 @@ -495,9 +495,13 @@ (( $+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 auser zstyle -s ":completion:${curcontext}:changes" max max || max=20 + if zstyle -t ":completion:${curcontext}:changes" current_user; then + auser=(-u $USER) + fi + 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 +552,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 $auser $amax $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 --------------070300070106020406090504--