From: Michael Denio <Michael.Denio@morganstanley.com>
To: Peter Stephenson <pws@csr.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: _perforce completer
Date: Fri, 23 Apr 2004 12:03:20 -0400 [thread overview]
Message-ID: <40893E48.1010609@morganstanley.com> (raw)
In-Reply-To: <8137.1082735886@csr.com>
[-- Attachment #1: Type: text/plain, Size: 718 bytes --]
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
[-- Attachment #2: _perforce.patch --]
[-- Type: text/plain, Size: 1127 bytes --]
--- _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
next prev parent reply other threads:[~2004-04-23 16:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-23 15:41 Michael Denio
2004-04-23 15:48 ` Clint Adams
2004-04-23 15:58 ` Peter Stephenson
2004-04-23 16:03 ` Michael Denio [this message]
2004-04-23 16:22 ` Peter Stephenson
2004-04-23 17:01 ` Michael Denio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40893E48.1010609@morganstanley.com \
--to=michael.denio@morganstanley.com \
--cc=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).