* PATCH: vcs_info: stop exporting everything
@ 2015-08-10 16:09 Mikael Magnusson
2015-08-10 16:11 ` PATCH: vcs_info: Adjust documentation for no longer exporting Mikael Magnusson
0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2015-08-10 16:09 UTC (permalink / raw)
To: zsh-workers
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* PATCH: vcs_info: Adjust documentation for no longer exporting
2015-08-10 16:09 PATCH: vcs_info: stop exporting everything Mikael Magnusson
@ 2015-08-10 16:11 ` Mikael Magnusson
0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2015-08-10 16:11 UTC (permalink / raw)
To: zsh-workers
Also contains a bonus syntax fix.
---
Doc/Zsh/contrib.yo | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 09ac5c8..909f980 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -756,7 +756,7 @@ 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
+These "formats" are set when we didn't detect a version control system
for the current directory or tt(vcs_info) was disabled. This is useful if
you want tt(vcs_info) to completely take over the generation of your
prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to
@@ -775,7 +775,7 @@ behavior using hooks.
kindex(max-exports)
item(tt(max-exports))(
Defines the maximum number of
-tt(vcs_info_msg_*_) variables tt(vcs_info) will export.
+tt(vcs_info_msg_*_) variables tt(vcs_info) will set.
)
kindex(enable)
item(tt(enable))(
@@ -1224,16 +1224,15 @@ All functions named tt(VCS_INFO_*) are for internal use only.
subsect(Variable Description)
startitem()
-item(tt(${vcs_info_msg_)var(N)tt(_)}) (Note the trailing underscore))
-(
+item(tt(${vcs_info_msg_)var(N)tt(_}) (Note the trailing underscore))(
Where var(N) is an integer, e.g., tt(vcs_info_msg_0_). These variables
are the storage for the informational message the last tt(vcs_info) call
has assembled. These are strongly connected to the tt(formats),
tt(actionformats) and tt(nvcsformats) styles described above. Those styles
are lists. The first member of that list gets expanded into
tt(${vcs_info_msg_0_}), the second into tt(${vcs_info_msg_1_})
-and the Nth into tt(${vcs_info_msg_N-1_}). These parameters are
-exported into the environment. (See the tt(max-exports) style above.)
+and the Nth into tt(${vcs_info_msg_N-1_}). (See the tt(max-exports)
+style above.)
)
enditem()
--
2.4.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-10 16:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-10 16:09 PATCH: vcs_info: stop exporting everything Mikael Magnusson
2015-08-10 16:11 ` PATCH: vcs_info: Adjust documentation for no longer exporting Mikael Magnusson
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).