From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17318 invoked from network); 28 Jun 2000 17:06:34 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jun 2000 17:06:34 -0000 Received: (qmail 19190 invoked by alias); 28 Jun 2000 17:06:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12112 Received: (qmail 19177 invoked from network); 28 Jun 2000 17:06:16 -0000 From: "Bart Schaefer" Message-Id: <1000628170534.ZM32412@candle.brasslantern.com> Date: Wed, 28 Jun 2000 17:05:34 +0000 In-Reply-To: <200006281448.KAA14282@ursula.cortexmachina.com> Comments: In reply to Peter Whaite "Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous" (Jun 28, 10:48am) References: <200006281448.KAA14282@ursula.cortexmachina.com> <200006281455.QAA03002@beta.informatik.hu-berlin.de> In-Reply-To: <200006281455.QAA03002@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous" (Jun 28, 4:55pm) X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Whaite , zsh-workers@sunsite.auc.dk Subject: PATCH: Re: Prompt %~ (sometimes) expands /local/src/zsh to ~unambiguous MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 28, 10:48am, Peter Whaite wrote: } } I have noticed that every now and then `print -P "%~"` prints "~unambiguous". On Jun 28, 4:55pm, Sven Wischnowsky wrote: } } Haven't investigated any further... the $compstate assoc contains an } element `unambiguous'. Maybe one of the recent changes to the } parameter code...? I don't know if it's one of the recent changes, but that does appear to be the problem: zagzig% setopt autonamedirs zagzig% typeset -A foo zagzig% foo[bar]=$PWD zagzig% print -P %~ ~bar } And maybe we should add code to prevent the automatic name-dir } behaviour for assoc elements anyway (if we don't have that already and } this is really the cause). Actually, I have a longstanding request that ~foo[bar] should work ... but that means changing the parser ... Certainly assigning to foo[bar] shouldn't define ~bar. Index: Src/params.c =================================================================== @@ -2020,6 +2020,7 @@ oldpm = pm->old; paramtab->addnode(paramtab, oldpm->nam, oldpm); if ((PM_TYPE(oldpm->flags) == PM_SCALAR) && + !(pm->flags & PM_HASHELEM) && oldpm->sets.cfn == strsetfn) adduserdir(oldpm->nam, oldpm->u.str, 0, 0); if (oldpm->flags & PM_EXPORTED) { @@ -2104,7 +2105,8 @@ { zsfree(pm->u.str); pm->u.str = x; - adduserdir(pm->nam, x, 0, 0); + if (!(pm->flags & PM_HASHELEM)) + adduserdir(pm->nam, x, 0, 0); } /* Function to get value of an array parameter */ -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net