From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2725 invoked from network); 21 Sep 2008 09:17:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Sep 2008 09:17:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 88277 invoked from network); 21 Sep 2008 09:17:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Sep 2008 09:17:05 -0000 Received: (qmail 13143 invoked by alias); 21 Sep 2008 09:16:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25697 Received: (qmail 13134 invoked from network); 21 Sep 2008 09:16:59 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 21 Sep 2008 09:16:59 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id E21F2802720D for ; Sun, 21 Sep 2008 11:16:50 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id B17041040A1; Sun, 21 Sep 2008 09:11:11 +0000 (UTC) Date: Sun, 21 Sep 2008 09:11:11 +0000 From: Clint Adams To: zsh-workers Subject: Re: Submitting vcs_info function Message-ID: <20080921091111.GA26463@scru.org> Mail-Followup-To: zsh-workers References: <20080917201859.GU2182@fsst.voodoo.lan> <20080917203242.GV2182@fsst.voodoo.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080917203242.GV2182@fsst.voodoo.lan> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/8296/Sun Sep 21 05:04:54 2008 on bifrost X-Virus-Status: Clean On Wed, Sep 17, 2008 at 10:32:42PM +0200, Frank Terbeck wrote: > +If you plan to use the information from var(vcs_info) in your prompt (which > +is its primary use), you need to enable the tt(PROMPT_SUBST) option. I don't think that this claim is accurate. Index: Functions/Prompts/prompt_clint_setup =================================================================== RCS file: /cvsroot/zsh/zsh/Functions/Prompts/prompt_clint_setup,v retrieving revision 1.9 diff -u -r1.9 prompt_clint_setup --- Functions/Prompts/prompt_clint_setup 17 May 2008 22:42:17 -0000 1.9 +++ Functions/Prompts/prompt_clint_setup 21 Sep 2008 09:07:53 -0000 @@ -15,6 +15,8 @@ local -A pc local p_date p_tty p_plat p_ver p_userpwd p_apm p_shlvlhist p_rc p_end p_win + autoload -Uz vcs_info + pcc[1]=${1:-'red'} pcc[2]=${2:-'cyan'} pcc[3]=${3:-'green'} @@ -36,7 +38,7 @@ [[ -n "$WINDOW" ]] && p_win="$pc['\(']%F{$pcc[4]}$WINDOW$pc['\)']" p_userpwd="$pc['<']%F{$pcc[3]}%n@%m$p_win%F{$pcc[5]}:%F{$pcc[4]}%~$pc['>']" - p_git="%(2v.-%U%2v%u-.)" + p_vcs="%(2v.%U%2v%u.)" p_shlvlhist="%fzsh%(2L./$SHLVL.) %B%h%b " p_rc="%(?..[%?%1v] )" @@ -46,7 +48,7 @@ prompt="$p_date$p_tty$p_plat$p_ver $p_userpwd -$p_shlvlhist$p_rc$p_git$p_end" +$p_shlvlhist$p_rc$p_vcs$p_end" PS2='%(4_.\.)%3_> %E' add-zsh-hook precmd prompt_clint_precmd @@ -63,9 +65,8 @@ [[ -o interactive ]] && jobs -l - git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return - git_ref=$(git-symbolic-ref HEAD 2> /dev/null) || git_ref="(no branch)" - psvar[2]=${git_ref#refs/heads/} + vcs_info + [[ -n $vcs_info_msg_0_ ]] && psvar[2]="$vcs_info_msg_0_" } prompt_clint_setup "$@"