Zsh Mailing List Archive
Messages sorted by:
Re: PATCH: vcs_info: Set NO_warn_create_global option
- X-seq: zsh-workers 27739
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: vcs_info: Set NO_warn_create_global option
- Date: Sun, 21 Feb 2010 21:06:35 +0100
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <100221092514.ZM24056@xxxxxxxxxxxxxxxxxxxxxx> (Bart Schaefer's message of "Sun, 21 Feb 2010 09:25:14 -0800")
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1266764004-15068-1-git-send-email-ft@xxxxxxxxxxxxxxxxxxx> <100221092514.ZM24056@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> On Feb 21, 3:53pm, Frank Terbeck wrote:
>} zstyle -e ':vcs_info:git:*' \
>} check-for-changes 'estyle-cfc && reply=( true ) || reply=( false )'
>} That however, welcomes me with this nice warning:
>} VCS_INFO_get_data_git:49: array parameter reply created globally in function
>} So, there are three options:
>} a) Get the big hammer and just disable `warn_create_global' in
>} b) Use a smaller hammer, and create a wrapper function around zstyle
>} for vcs_info, that disables the option locally.
>} c) Disable `warn_create_global' in code executed by "zstyle -e". Or
>} make `reply' and `REPLY' special in that case. Or whatever makes the
>} most sense.
> There's another option
> b.5) Write the style like this:
> zstyle -e ':vcs_info:git:*' \
> check-for-changes 'typeset -g reply; \
> estyle-cfc && reply=( true ) || reply=( false )'
Hm yeah. But I think it would be way more convenient to let the shell do
that automatically, since at least here `reply' is supposed to be used.
> Also, rather than (c) I might suggest
> d) Suppress warn_create_global for the parameters "reply" and "REPLY"
> at all times. In fact it probably ought to be suppressed for STTY
> and a few others in the "Parameters Used By The Shell" section of
> the manual.
I guess, you've seen the patch I set for "c)". That was easy enough.
You're probably right that this should always apply to `reply', `REPLY'
and the like. I don't know how to do that, though. Would you always have
such parameters be available globally, even after an `unset'?
Any ideas where to apply the leverage?
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by: