Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: vcs_info: stop exporting everything



This basically just removes -x from every local definition in
vcsinfo. There is one instance where it is left, the LC_* handling,
where it more or less works as intended.

The patch does not rename the max-exports style for pretty obvious
reasons.

---
 Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr | 2 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_hg  | 2 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_p4  | 2 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_svk | 2 +-
 Functions/VCS_Info/Backends/VCS_INFO_get_data_svn | 2 +-
 Functions/VCS_Info/VCS_INFO_formats               | 4 ++--
 Functions/VCS_Info/VCS_INFO_hook                  | 4 ++--
 Functions/VCS_Info/VCS_INFO_quilt                 | 6 +++---
 Functions/VCS_Info/VCS_INFO_set                   | 6 +++---
 Functions/VCS_Info/vcs_info                       | 9 +++++----
 Functions/VCS_Info/vcs_info_lastmsg               | 2 +-
 Functions/VCS_Info/vcs_info_printsys              | 2 +-
 12 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr
index cae1a3b..e8c8e81 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr
@@ -6,7 +6,7 @@
 setopt localoptions noksharrays extendedglob NO_shwordsplit
 local bzrbase bzrbr bzr_changes bzr_type
 local -a bzrinfo
-local -xA hook_com bzr_info
+local -A hook_com bzr_info
 
 VCS_INFO_bzr_get_info() {
     bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index 1274ca3..f35ad59 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -16,7 +16,7 @@ local -a hgid_args defrevformat defbranchformat \
     hgbmarks mqpatches mqseries mqguards mqunapplied hgmisc \
     i_patchguards i_negguards i_posguards
 
-local -xA hook_com
+local -A hook_com
 
 hgbase=${vcs_comm[basedir]}
 rrn=${hgbase:t}
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4 b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4
index 430cfa6..3298849 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_p4
@@ -6,7 +6,7 @@
 setopt localoptions extendedglob
 local p4base a b
 local -A p4info
-local -xA hook_com
+local -A hook_com
 
 ${vcs_comm[cmd]} info | while IFS=: read a b; do p4info[${a// /_}]="${b## #}"; done
 p4base=${vcs_comm[basedir]}
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk
index 6107a14..1d2d22f 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svk
@@ -4,7 +4,7 @@
 
 setopt localoptions NO_shwordsplit
 local svkbranch svkbase
-local -xA hook_com
+local -A hook_com
 
 svkbase=${vcs_comm[basedir]}
 rrn=${svkbase:t}
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
index e56afee..e1334f6 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn
@@ -8,7 +8,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit
 local svnbase svnbranch a b rrn
 local -i rc
 local -A svninfo parentinfo cwdinfo
-local -xA hook_com
+local -A hook_com
 
 svnbase=".";
 svninfo=()
diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats
index 1380919..4d0dd75 100644
--- a/Functions/VCS_Info/VCS_INFO_formats
+++ b/Functions/VCS_Info/VCS_INFO_formats
@@ -5,7 +5,7 @@
 setopt localoptions noksharrays NO_shwordsplit
 local msg tmp
 local -i i
-local -xA hook_com
+local -A hook_com
 # The _origs are needed because hooks can change values and there would
 # be no way to get the originals back for later hooks (a hook is run for
 # each message, that's being created).
@@ -68,7 +68,7 @@ if [[ -n ${hook_com[unstaged]} ]] ; then
 fi
 
 if [[ ${quiltmode} != 'standalone' ]] && VCS_INFO_hook "pre-addon-quilt"; then
-    local -x REPLY
+    local REPLY
     VCS_INFO_quilt addon
     hook_com[quilt]="${REPLY}"
     unset REPLY
diff --git a/Functions/VCS_Info/VCS_INFO_hook b/Functions/VCS_Info/VCS_INFO_hook
index 479f596..94ae630 100644
--- a/Functions/VCS_Info/VCS_INFO_hook
+++ b/Functions/VCS_Info/VCS_INFO_hook
@@ -3,8 +3,8 @@
 ## Distributed under the same BSD-ish license as zsh itself.
 
 local hook static func
-local -x context hook_name
-local -xi ret
+local context hook_name
+local -i ret
 local -a hooks tmp
 local -i debug
 
diff --git a/Functions/VCS_Info/VCS_INFO_quilt b/Functions/VCS_Info/VCS_INFO_quilt
index 34ff1ed..bc71cfb 100644
--- a/Functions/VCS_Info/VCS_INFO_quilt
+++ b/Functions/VCS_Info/VCS_INFO_quilt
@@ -86,9 +86,9 @@ function VCS_INFO_quilt() {
     local mode="$1"
     local patches pc tmp qstring root
     local -i ret
-    local -x context
+    local context
     local -a applied unapplied all applied_string unapplied_string quiltcommand quilt_env
-    local -Ax hook_com
+    local -A hook_com
 
     context=":vcs_info:${vcs}.quilt-${mode}:${usercontext}:${rrn}"
     zstyle -t "${context}" use-quilt || return 1
@@ -183,7 +183,7 @@ function VCS_INFO_quilt() {
         VCS_INFO_set
         ;;
     (addon)
-        # When VCS_INFO_quilt() is called with "addon" a "local -x REPLY" variable
+        # When VCS_INFO_quilt() is called with "addon" a "local REPLY" variable
         # should be in place. That variable can be unset after it's being used.
         REPLY="${qstring}"
         ;;
diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set
index 5087be4..484c793 100644
--- a/Functions/VCS_Info/VCS_INFO_set
+++ b/Functions/VCS_Info/VCS_INFO_set
@@ -8,7 +8,7 @@ local -i i j
 if [[ $1 == '--nvcs' ]] ; then
     [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 ))
     for i in {0..$((maxexports - 1))} ; do
-        typeset -gx vcs_info_msg_${i}_=
+        typeset -g vcs_info_msg_${i}_=
     done
     VCS_INFO_nvcsformats $2
     [[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs"
@@ -17,12 +17,12 @@ fi
 (( ${#msgs} - 1 < 0 )) && return 0
 for i in {0..$(( ${#msgs} - 1 ))} ; do
     (( j = i + 1 ))
-    typeset -gx vcs_info_msg_${i}_=${msgs[$j]}
+    typeset -g vcs_info_msg_${i}_=${msgs[$j]}
 done
 
 if (( i < maxexports )) ; then
     for j in {$(( i + 1 ))..${maxexports}} ; do
-        [[ -n ${(P)${:-vcs_info_msg_${j}_}} ]] && typeset -gx vcs_info_msg_${j}_=
+        [[ -n ${(P)${:-vcs_info_msg_${j}_}} ]] && typeset -g vcs_info_msg_${j}_=
     done
 fi
 return 0
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index 4693869..350b189 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -51,10 +51,11 @@ vcs_info () {
     local pat
     local -i found retval
     local -a enabled disabled dps
-    local -x usercontext vcs rrn quiltmode LC_MESSAGES
-    local -ix maxexports
-    local -ax msgs
-    local -Ax vcs_comm hook_com backend_misc user_data
+    local usercontext vcs rrn quiltmode
+    local -x LC_MESSAGES
+    local -i maxexports
+    local -a msgs
+    local -A vcs_comm hook_com backend_misc user_data
 
     LC_MESSAGES=C
     if [[ -n ${LC_ALL} ]]; then
diff --git a/Functions/VCS_Info/vcs_info_lastmsg b/Functions/VCS_Info/vcs_info_lastmsg
index ddfaaf8..438567c 100644
--- a/Functions/VCS_Info/vcs_info_lastmsg
+++ b/Functions/VCS_Info/vcs_info_lastmsg
@@ -5,7 +5,7 @@
 emulate -L zsh
 
 local -i i
-local -ix maxexports
+local -i maxexports
 
 VCS_INFO_maxexports
 for i in {0..$((maxexports - 1))} ; do
diff --git a/Functions/VCS_Info/vcs_info_printsys b/Functions/VCS_Info/vcs_info_printsys
index f290614..b44b9c9 100644
--- a/Functions/VCS_Info/vcs_info_printsys
+++ b/Functions/VCS_Info/vcs_info_printsys
@@ -7,7 +7,7 @@ setopt extendedglob
 
 local sys
 local -a disabled enabled
-local -Ax vcs_comm
+local -A vcs_comm
 
 zstyle -a ":vcs_info:-init-:${1:-default}:-all-" "enable" enabled
 (( ${#enabled} == 0 )) && enabled=( all )
-- 
2.4.0



Messages sorted by: Reverse Date, Date, Thread, Author