From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20667 invoked from network); 18 May 2008 05:33:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) 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.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 May 2008 05:33:21 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 74389 invoked from network); 18 May 2008 05:33:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 May 2008 05:33:12 -0000 Received: (qmail 17956 invoked by alias); 18 May 2008 05:33:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25062 Received: (qmail 17938 invoked from network); 18 May 2008 05:33:09 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 May 2008 05:33:09 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTP id 20D9D80589A4 for ; Sun, 18 May 2008 07:33:04 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id C4AE4104064; Sun, 18 May 2008 05:33:01 +0000 (UTC) Date: Sun, 18 May 2008 05:33:01 +0000 From: Clint Adams To: "martin f. krafft" , "martin f. krafft" Cc: zsh-workers@sunsite.dk Subject: Re: [PATCH] typeset reply array Message-ID: <20080518053301.GA8521@scru.org> Mail-Followup-To: "martin f. krafft" , "martin f. krafft" , zsh-workers@sunsite.dk References: <1211026277-27464-1-git-send-email-madduck@debian.org> <1211026277-27464-2-git-send-email-madduck@debian.org> <1211025324-25630-1-git-send-email-madduck@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1211026277-27464-2-git-send-email-madduck@debian.org> <1211025324-25630-1-git-send-email-madduck@debian.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: ClamAV 0.91.2/7147/Sun May 18 03:30:04 2008 on bifrost X-Virus-Status: Clean I think that some of these will break things. For example, if you keep _comp_dumpfile local to compinit, when/if compinit calls compdump, problems might ensue. I don't know why we can't call compdump with an argument though. On Sat, May 17, 2008 at 12:55:24PM +0100, martin f. krafft wrote: > From: martin f. krafft > > With warn_create_global set, the function otherwise causes warnings > like this: > > url-quote-magic:1: array parameter reply created globally in > function > > Signed-off-by: martin f. krafft > --- > Functions/Zle/url-quote-magic | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/Functions/Zle/url-quote-magic b/Functions/Zle/url-quote-magic > index 826d26d..e15d117 100644 > --- a/Functions/Zle/url-quote-magic > +++ b/Functions/Zle/url-quote-magic > @@ -65,11 +65,12 @@ zstyle -m ':url-quote-magic:\*' url-metas '*' || > zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}=' > > zstyle -m ':url-quote-magic:\*' url-seps '*' || > - zstyle -e ':url-quote-magic:*' url-seps 'reply=(";&<>${histchars[1]}")' > + zstyle -e ':url-quote-magic:*' url-seps 'typeset -a reply; reply=(";&<>${histchars[1]}")' > > zstyle -m :url-quote-magic url-globbers '*' || > zstyle -e :url-quote-magic url-globbers \ > 'zmodload -i zsh/parameter; > + typeset -a reply; > reply=( noglob > ${(k)galiases[(R)(* |)(noglob|urlglobber|globurl) *]:-} > ${(k)aliases[(R)(* |)(noglob|urlglobber|globurl) *]:-} )' > -- > 1.5.5.1 On Sat, May 17, 2008 at 01:11:17PM +0100, martin f. krafft wrote: > With warn_create_global set, the function otherwise causes warnings > like this: > > compinit:123: scalar parameter _comp_dumpfile created globally in function > compinit:130: array parameter _comp_options created globally in function > compinit:164: scalar parameter _comp_setup created globally in function > compinit:169: array parameter compprefuncs created globally in function > compinit:170: array parameter comppostfuncs created globally in function > > Signed-off-by: martin f. krafft > --- > Completion/compinit | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/Completion/compinit b/Completion/compinit > index a4edd24..30dc26c 100644 > --- a/Completion/compinit > +++ b/Completion/compinit > @@ -120,13 +120,14 @@ typeset -gA _lastcomp > # Remember dumpfile. > if [[ -n $_i_dumpfile ]]; then > # Explicitly supplied dumpfile. > - _comp_dumpfile="$_i_dumpfile" > + local _comp_dumpfile="$_i_dumpfile" > else > _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump" > fi > > # The standard options set in completion functions. > > +typeset -a _comp_options > _comp_options=( > bareglobqual > extendedglob > @@ -157,6 +158,7 @@ _comp_options=( > # have a valid stdin descriptor (zle closes it before calling widgets) > # and don't get confused by user's ZERR trap handlers. > > +typeset -l _comp_setup > _comp_setup='setopt localoptions localtraps ${_comp_options[@]}; > local IFS=$'\'\ \\t\\r\\n\\0\'' > exec @@ -165,8 +167,8 @@ _comp_setup='setopt localoptions localtraps ${_comp_options[@]}; > # These can hold names of functions that are to be called before/after all > # matches have been generated. > > -compprefuncs=() > -comppostfuncs=() > +typeset -a compprefuncs; compprefuncs=() > +typeset -a comppostfuncs; comppostfuncs=() > > # Loading it now ensures that the `funcstack' parameter is always correct. > > -- > 1.5.5.1