zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: zsh-workers@zsh.org
Subject: PATCH: (4/4) vcs_info: nvcsformats style should be used if the system is disabled
Date: Wed, 30 Mar 2011 22:37:16 +0200	[thread overview]
Message-ID: <1301517436-11451-5-git-send-email-ft@bewatermyfriend.org> (raw)
In-Reply-To: <1301517436-11451-1-git-send-email-ft@bewatermyfriend.org>

I was actually wondering, that this was not the case yet...
---
 Doc/Zsh/contrib.yo              |   10 +++++-----
 Functions/VCS_Info/VCS_INFO_set |    5 -----
 Functions/VCS_Info/vcs_info     |    5 +++--
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index bc4a814..476e7ca 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -756,11 +756,11 @@ revision number. This style lets you modify how that string should look.
 )
 kindex(nvcsformats)
 item(tt(nvcsformats))(
-These "formats" are exported when we didn't detect
-a version control system for the current directory. This is useful if you
-want var(vcs_info) to completely take over the generation of your prompt.
-You would do something like tt(PS1='${vcs_info_msg_0_}') to accomplish
-that.
+These "formats" are exported when we didn't detect a version control system
+for the current directory or var(vcs_info) was disabled. This is useful if
+you want var(vcs_info) to completely take over the generation of your
+prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to
+accomplish that.
 )
 kindex(hgrevformat)
 item(tt(hgrevformat))(
diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set
index 23dc06b..5087be4 100644
--- a/Functions/VCS_Info/VCS_INFO_set
+++ b/Functions/VCS_Info/VCS_INFO_set
@@ -5,11 +5,6 @@
 setopt localoptions noksharrays NO_shwordsplit
 local -i i j
 
-if [[ $1 == '--clear' ]] ; then
-    for i in {0..9} ; do
-        unset vcs_info_msg_${i}_
-    done
-fi
 if [[ $1 == '--nvcs' ]] ; then
     [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 ))
     for i in {0..$((maxexports - 1))} ; do
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index 385a451..513489b 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -37,6 +37,7 @@ for func in ${static_functions} ; do
     autoload -Uz ${func}
 done
 
+[[ -n ${(Mk)parameters:#vcs_info_msg_<->_} ]] && unset ${parameters[(I)vcs_info_msg_<->_]}
 VCS_INFO_set --nvcs '-preinit-'
 vcs_info_setsys
 
@@ -77,7 +78,7 @@ vcs_info () {
     (( ${#enabled} == 0 )) && enabled=( all )
 
     if [[ -n ${(M)enabled:#(#i)none} ]] ; then
-        [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear
+        [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs
         return 0
     fi
 
@@ -90,7 +91,7 @@ vcs_info () {
 
     for pat in ${dps} ; do
         if [[ ${PWD} == ${~pat} ]] ; then
-            [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear
+            [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs
             return 0
         fi
     done
-- 
1.7.4.1.140.g89781


      parent reply	other threads:[~2011-03-30 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 20:37 PATCH: (0/4) Frank Terbeck
2011-03-30 20:37 ` PATCH: (1/4) vcs_info: Support registering hooks independent of the context Frank Terbeck
2011-03-30 20:37 ` PATCH: (2/4) vcs_info: Add functions to add/remove static hooks Frank Terbeck
2011-03-30 20:37 ` PATCH: (3/4) vcs_info: Add `no-vcs' hook Frank Terbeck
2011-03-30 20:37 ` Frank Terbeck [this message]

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=1301517436-11451-5-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=zsh-workers@zsh.org \
    /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).