From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2767 invoked from network); 20 Aug 2006 21:38:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,SUBJ_HAS_UNIQ_ID autolearn=ham version=3.1.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Aug 2006 21:38:40 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 57617 invoked from network); 20 Aug 2006 21:38:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Aug 2006 21:38:34 -0000 Received: (qmail 13283 invoked by alias); 20 Aug 2006 21:38:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22650 Received: (qmail 13273 invoked from network); 20 Aug 2006 21:38:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Aug 2006 21:38:31 -0000 Received: (qmail 57374 invoked from network); 20 Aug 2006 21:38:31 -0000 Received: from mtaout01-winn.ispmail.ntl.com (81.103.221.47) by a.mx.sunsite.dk with SMTP; 20 Aug 2006 21:38:30 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20060820213829.GDJD15018.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sun, 20 Aug 2006 22:38:29 +0100 Received: from pwslaptop.csr.com ([81.107.41.155]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20060820213829.THVY644.aamtaout01-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 20 Aug 2006 22:38:29 +0100 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.7/8.13.7) with ESMTP id k7KLcO2x003269; Sun, 20 Aug 2006 22:38:24 +0100 Message-Id: <200608202138.k7KLcO2x003269@pwslaptop.csr.com> From: Peter Stephenson To: zsh-workers@sunsite.dk, pws@pwslaptop.csr.com Subject: Re: zstyle is badly broken as of 20060817 In-Reply-To: Message from Bart Schaefer of "Sun, 20 Aug 2006 13:44:19 PDT." <060820134419.ZM4072@torch.brasslantern.com> Date: Sun, 20 Aug 2006 22:38:24 +0100 Bart Schaefer wrote: > Also now there's no way to get the style back again: > > schaefer<501> zstyle ":completion:*:default" list-prompt '' > schaefer<502> zstyle | grep list-prompt > list-prompt > schaefer<503> zstyle -d ":completion:*:default" list-prompt > schaefer<504> zstyle | grep list-prompt > schaefer<505> zstyle ":completion:*:default" list-prompt "Go On" > schaefer<506> zstyle | grep list-prompt > schaefer<507> echo $? > 1 > schaefer<508> Deleting styles had a bad effect because there's a zlstyles variable which always points to the last variable added, so that new styles are added there. This doesn't work so well if you can remove styles. I've just removed zlstyles. If an optimisation is really necessary a better one would be to hash the styles. This fixed the symptom in my case. I haven't looked at the effect of list-prompt after being removed. I probably won't get a chance for some weeks. Anyone else is welcome to look at anything. Index: Src/Modules/zutil.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/zutil.c,v retrieving revision 1.19 diff -u -r1.19 zutil.c --- Src/Modules/zutil.c 20 Aug 2006 17:04:58 -0000 1.19 +++ Src/Modules/zutil.c 20 Aug 2006 21:36:56 -0000 @@ -54,7 +54,7 @@ /* List of styles. */ -static Style zstyles, zlstyles; +static Style zstyles; /* Memory stuff. */ @@ -117,7 +117,7 @@ zsfree(s->name); zfree(s, sizeof(*s)); } - zstyles = zlstyles = NULL; + zstyles = NULL; } /* Get the style struct for a name. */ @@ -233,11 +233,8 @@ s->pats = NULL; s->name = ztrdup(name); - if (zlstyles) - zlstyles->next = s; - else - zstyles = s; - zlstyles = s; + s->next = zstyles; + zstyles = s; return s; } @@ -1748,7 +1745,7 @@ int setup_(UNUSED(Module m)) { - zstyles = zlstyles = NULL; + zstyles = NULL; return 0; } -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/