Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Small problem with typeset -U.



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@xxxxxx
-------------------------------------------------------------------------
===============================================
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;
> 	    };





Messages sorted by: Reverse Date, Date, Thread, Author