From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id XAA15344 for ; Fri, 12 Jul 1996 23:12:17 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id JAA10198; Fri, 12 Jul 1996 09:03:34 -0400 (EDT) Resent-Date: Fri, 12 Jul 1996 09:03:34 -0400 (EDT) Date: Fri, 12 Jul 1996 17:01:17 +0400 (MOW) From: Andrej Borsenkow X-Sender: bor@itsrm1 Reply-To: borsenkow.msk@sni.de To: Zsh workers mailing list Subject: Small problem with typeset -U. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"q8vIV.0.GV2.bqavn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1621 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi! A little problem with mirror parameters (like path and PATH) and typeset -U command. If I set -U option for one of pair of mirrored parameters, it is not set for other. Thus, e.g. typeset -U path PATH=$PATH:~/bin:~/bin still results in ~/bin being in path/PATH two times. The same holds also if I set -U for path and try to change PATH. It is true for any set of mirrored parameters. I have a small patch for zsh-3.0-pre2, which (I hope;) corrects it. It checks, wether parameter is special, and wether it has counterpart; if yes, it sets PM_UNIQUE for it also. It is probably incomplete (it does nothing if counterpart doesn't exist - should it be considered an error?) but as far as I can tell, it works in more logical way. I think, that it would be better solved by adding one more flag (say, PM_MIRRORED). It would provide for creating arbitrary user defined paires of mirrored parameters. Alas! I am not so deep in zsh as to dare to write it. I will sometime do - or is it already implemented in some other way? Please, Cc any replies to my address. thanks greetings ------------------------------------------------------------------------- Andrej Borsenkow Fax: +7 (095) 252 01 05 SNI ITS Moscow Tel: +7 (095) 252 13 88 NERV: borsenkow.msk E-Mail: borsenkow.msk@sni.de ------------------------------------------------------------------------- =============================================== 2801a2802,2811 > if ((pm->flags & PM_SPECIAL) && pm->ename) { > Param pme; > > pme = (Param) paramtab->getnode(paramtab, pm->ename); > if (pme) > if (on & PM_UNIQUE) > pme->flags |= PM_UNIQUE; > else > pme->flags &= ~PM_UNIQUE; > }; 2870a2881,2890 > if ((pm->flags & PM_SPECIAL) && pm->ename) { > Param pme; > > pme = (Param) paramtab->getnode(paramtab, pm->ename); > if (pme) > if (on & PM_UNIQUE) > pme->flags |= PM_UNIQUE; > else > pme->flags &= ~PM_UNIQUE; > };