From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2283 invoked by alias); 24 Jan 2015 15:34:43 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34368 Received: (qmail 28638 invoked from network); 24 Jan 2015 15:34:32 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:subject:message-id :mime-version:content-type; s=mesmtp; bh=XMc8wpGfpaOl1Fsv7fUT9tn ey7E=; b=2xrGoF0jkkQb10pgZXVsLT3Tf0bXS+CMktmvrcDXiqgtMEP9oYKr0iI 9tkAFMYzi47TH5f+y0qEHXzZ/J+AvXrwh3QWJ58sr3Ur6ZyGhU74+Do0b3u0iCde CR9L85e7oZC1xkqn9YDF9fatuGVAyPZ4ztAQYtVJcCouQWrbEeQU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:subject :message-id:mime-version:content-type; s=smtpout; bh=XMc8wpGfpaO l1Fsv7fUT9tney7E=; b=hl+Y2SI+Ld4Cu8NUAujwEFuA/Y+j+mZi8j0VNX61Spx +LZsXw1mwa07bQDfbzdYLy/zFPGqHlvqX+nEl03IP8ao7bHpehpEOucbAcRB//RH AS/ZUdAYXd+g8JJoD2e02CDSz2165ryurARjmbPCcqhFkrQ7tn2xACpll5og1NyU = X-Sasl-enc: OHird9eBNUkzCP8tWClbM/NvUMjYjpZKb8pyAnB+K0pG 1422113671 Date: Sat, 24 Jan 2015 15:34:28 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] _zstyle vcs_info completion: Add missing styles Message-ID: <20150124153428.GD20359@tarsus.local2> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="xesSdrSSBC0PokLI" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --xesSdrSSBC0PokLI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Patch that adds a few vcs_info-specific styles to zstyle's completion. --xesSdrSSBC0PokLI Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="0002-_zstyle-vcs_info-completion-Add-missing-styles.patch" >>From 70593fe82ced51aea5783f3f1f8e33ab016143c0 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 24 Jan 2015 05:39:01 +0000 Subject: [PATCH 2/2] _zstyle vcs_info completion: Add missing styles --- Completion/Zsh/Command/_zstyle | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index c8e1c2b..2ebae71 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -20,6 +20,9 @@ _completers() { compadd "$@" "$disp[@]" - "$us${^list[@]}" } +_vcs_info_hooks() { + compadd - ${functions[(I)+vi-*]#+vi-} +} # Assoc array of styles; the values give the possible top-level # contexts: # c completion @@ -176,7 +179,10 @@ styles=( actionformats v:vcs-format branchformat v:branch-format nvcsformats v: + hgrevformat v:hgrev-format stgitformat v:stg-format + patch-format v:patch-format + nopatch-format v:patch-format max-exports v: enable v:vcs disable v:vcs @@ -190,7 +196,16 @@ styles=( use-server v:bool use-simple v:bool get-revision v:bool + get-mq v:bool + get-bookmarks v:bool + get-unapplied v:bool + debug v:bool + hooks v:_vcs_info_hooks use-prompt-escapes v:bool + use-quilt v:bool + quilt-standalone v:bool + quilt-patch-dir v:_directories + quiltcommand v:_command_names chpwd z:bool progress z:progress @@ -555,6 +570,17 @@ while (( $#state )); do fi ;; + (hgrev-format) + if [[ $PREFIX = *% ]]; then + compset -P '*%' + _values -s '' 'format replacement' \ + 'h[current revision hash (global)]' \ + 'r[current revision number (local)]' + else + _message -e formats 'vcs format' + fi + ;; + (stg-format) if [[ $PREFIX = *% ]]; then compset -P '*%' @@ -566,6 +592,22 @@ while (( $#state )); do fi ;; + (patch-format) + if [[ $PREFIX = *% ]]; then + compset -P '*%' + _values -s '' 'format replacement' \ + 'p[name of top-most patch (applied-string)]' \ + 'u[number of unapplied patches (unapplied-string)]' \ + 'n[number of applied patches]' \ + 'c[number of unapplied patches.]' \ + 'a[number of all patches]' \ + 'g[names of active mq guards (hg backend)]' \ + 'G[number of active mq guards (hg backend)]' + else + _message -e formats 'vcs format' + fi + ;; + (_*) ${=state[1]} $suf ;; -- 1.9.1 --xesSdrSSBC0PokLI--