From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1391 invoked from network); 18 May 2008 19:24:54 -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=AWL,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 19:24:54 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36390 invoked from network); 18 May 2008 19:24:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 May 2008 19:24:48 -0000 Received: (qmail 24425 invoked by alias); 18 May 2008 19:24:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25068 Received: (qmail 24410 invoked from network); 18 May 2008 19:24:44 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 May 2008 19:24:44 -0000 Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bifrost.dotsrc.org (Postfix) with ESMTP id ED27F80589A4 for ; Sun, 18 May 2008 21:24:34 +0200 (CEST) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080518192817.GXXM14647.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Sun, 18 May 2008 20:28:17 +0100 Received: from pws-pc ([81.107.40.67]) by aamtaout03-winn.ispmail.ntl.com with ESMTP id <20080518193245.KOJK26699.aamtaout03-winn.ispmail.ntl.com@pws-pc> for ; Sun, 18 May 2008 20:32:45 +0100 Date: Sun, 18 May 2008 20:23:26 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: [PATCH] typeset reply array Message-ID: <20080518202326.1d2b3f3b@pws-pc> In-Reply-To: <20080518181735.1191bd8a@pws-pc> 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> <20080518053301.GA8521@scru.org> <20080518181735.1191bd8a@pws-pc> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/7150/Sun May 18 20:10:15 2008 on bifrost X-Virus-Status: Clean On Sun, 18 May 2008 18:17:35 +0100 Peter Stephenson wrote: > Commonly used but non-global parameters such as "reply" could, and > probably should, be made local to the top-level of completion at around > the point where the options get set. This would save them appearing in > the user's own space, which was the whole point of warncreateglobal in > the first place. > > A "typeset -g" for variables that *should* be global makes perfect > sense. The "-g" should definitely be present even if the code isn't > inside a function (although the compinit stuff is), since we shouldn't > make that assumption. This does that. It's the same basic principle as the original patch, but should be safe. Index: Completion/compinit =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/compinit,v retrieving revision 1.20 diff -u -r1.20 compinit --- Completion/compinit 12 Apr 2008 16:32:43 -0000 1.20 +++ Completion/compinit 18 May 2008 19:23:01 -0000 @@ -118,6 +118,7 @@ typeset -gA _lastcomp # Remember dumpfile. +typeset -g _comp_dumpfile if [[ -n $_i_dumpfile ]]; then # Explicitly supplied dumpfile. _comp_dumpfile="$_i_dumpfile" @@ -127,6 +128,7 @@ # The standard options set in completion functions. +typeset -ga _comp_options _comp_options=( bareglobqual extendedglob @@ -158,14 +160,18 @@ # have a valid stdin descriptor (zle closes it before calling widgets) # and don't get confused by user's ZERR trap handlers. +typeset -g _comp_setup _comp_setup='setopt localoptions localtraps ${_comp_options[@]}; local IFS=$'\'\ \\t\\r\\n\\0\'' exec Web page now at http://homepage.ntlworld.com/p.w.stephenson/