Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: problem redeclaring path variable (ksh incompatibility)
- X-seq: zsh-workers 20999
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: problem redeclaring path variable (ksh incompatibility)
- Date: Thu, 17 Mar 2005 17:28:47 +0000
- In-reply-to: <1050317165007.ZM32408@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <423994CA.4010609@xxxxxxxxxxxxxx> <1050317165007.ZM32408@xxxxxxxxxxxxxxxxxxxxxxx>
On Mar 17, 4:50pm, Bart Schaefer wrote:
}
} If we were going to attempt to change this, the right way would be to add
} a new option, perhaps called LOCAL_SPECIALS, which would be on by default.
} "emulate sh" et al. would unset this option. When NO_LOCAL_SPECIALS, the
} typeset builtin would behave as if the -h option were always present.
}
} Other, less desirable approaches might be to tie this behavior to the
} POSIX_BUILTINS or KSH_TYPESET options. Possibly it should be tied to
} KSH_TYPESET even if LOCAL_SPECIALS is added.
Here's a short patch that illustrates how this would work. With this
patch applied, Michael's function works as he expects, and "typeset +h"
can be used to force a special to remain locally special.
Index: builtin.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/builtin.c,v
retrieving revision 1.30
diff -c -r1.30 builtin.c
--- builtin.c 18 Feb 2005 17:05:15 -0000 1.30
+++ builtin.c 17 Mar 2005 17:23:35 -0000
@@ -2236,6 +2236,9 @@
if (on & PM_TIED)
off |= PM_INTEGER | PM_EFLOAT | PM_FFLOAT | PM_ARRAY | PM_HASHED;
+ if (isset(KSHTYPESET))
+ on |= PM_HIDE;
+
on &= ~off;
queue_signals();
Messages sorted by:
Reverse Date,
Date,
Thread,
Author