From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19131 invoked from network); 31 Dec 2008 14:48:33 -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=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; 31 Dec 2008 14:48:33 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 90628 invoked from network); 31 Dec 2008 14:48:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Dec 2008 14:48:25 -0000 Received: (qmail 15920 invoked by alias); 31 Dec 2008 14:48:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26215 Received: (qmail 15909 invoked from network); 31 Dec 2008 14:48:19 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 31 Dec 2008 14:48:19 -0000 Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.18.16]) by bifrost.dotsrc.org (Postfix) with ESMTP id B2E2080308BE for ; Wed, 31 Dec 2008 15:48:15 +0100 (CET) Received: from [83.135.216.104] (helo=fsst.voodoo.lan) by smtprelay04.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1LI2Mp-0004iK-QC for zsh-workers@sunsite.dk; Wed, 31 Dec 2008 15:48:15 +0100 Received: from hawk by fsst.voodoo.lan with local (Exim 4.69) (envelope-from ) id 1LI2M4-0000gV-6F for zsh-workers@sunsite.dk; Wed, 31 Dec 2008 15:47:28 +0100 Date: Wed, 31 Dec 2008 15:47:28 +0100 From: Frank Terbeck To: zsh workers Subject: PATCH: vcs_info, implement disable-patterns style (2nd try) Message-ID: <20081231144728.GD4052@fsst.voodoo.lan> Mail-Followup-To: zsh workers References: <20081231144239.GC4052@fsst.voodoo.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20081231144239.GC4052@fsst.voodoo.lan> User-Agent: Mutt/1.5.18 (2008-05-17) X-Df-Sender: 430444 X-Virus-Scanned: ClamAV 0.92.1/8819/Wed Dec 31 15:28:33 2008 on bifrost X-Virus-Status: Clean --- Frank Terbeck : > + zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable-patterns" dps > + (( ${#dps} == 0 )) && dps=() Well, that 2nd line is obviously not needed... Here is an updated patch. Regards, Frank Doc/Zsh/contrib.yo | 10 ++++++++++ Functions/VCS_Info/vcs_info | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index c393d28..826fb20 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -506,6 +506,16 @@ A list of VCSs, you don't want var(vcs_info) to test for repositories (checked in the var(-init-) context, too). Only used if tt(enable) contains tt(ALL). ) +kindex(disable-patterns) +item(tt(disable-patterns))( +A list of patterns that are checked against tt($PWD). If the pattern +matches, var(vcs_info) will is disabled. This style is checked in the +var(:vcs_info:-init-:*:-all-) context. + +Say, tt(~/.zsh) is a directory under version control, in which you do +not want var(vcs_info) to be active, do: +example(zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+LPAR()|/*+RPAR()") +) kindex(command) item(tt(command))( This style causes var(vcs_info) to use the supplied string as the command diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 7ecd122..a821e4d 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -41,8 +41,9 @@ vcs_info () { emulate -L zsh setopt extendedglob + local pat local -i found - local -a enabled disabled + local -a enabled disabled dps local -x usercontext vcs rrn local -ix maxexports local -ax msgs @@ -64,6 +65,15 @@ vcs_info () { zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable" disabled fi + zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable-patterns" dps + + for pat in ${dps} ; do + if [[ ${PWD} == ${~pat} ]] ; then + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + return 0 + fi + done + VCS_INFO_maxexports (( found = 0 )) -- 1.6.1