zsh-workers
 help / color / mirror / code / Atom feed
* Small problem with typeset -U.
@ 1996-07-12 13:01 Andrej Borsenkow
  1996-07-12 13:07 ` Andrej Borsenkow
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andrej Borsenkow @ 1996-07-12 13:01 UTC (permalink / raw)
  To: Zsh workers mailing list

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;
> 	    };




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-07-12 15:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-12 13:01 Small problem with typeset -U Andrej Borsenkow
1996-07-12 13:07 ` Andrej Borsenkow
1996-07-12 15:41 ` Zoltan Hidvegi
1996-07-12 15:48 ` Zefram
1996-07-12 15:48 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).