From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8432 invoked from network); 17 Mar 2005 17:29:03 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Mar 2005 17:29:03 -0000 Received: (qmail 65253 invoked from network); 17 Mar 2005 17:28:57 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Mar 2005 17:28:57 -0000 Received: (qmail 20212 invoked by alias); 17 Mar 2005 17:28:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20999 Received: (qmail 20203 invoked from network); 17 Mar 2005 17:28:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Mar 2005 17:28:53 -0000 Received: (qmail 64995 invoked from network); 17 Mar 2005 17:28:53 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 17 Mar 2005 17:28:50 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IDI007R1B80U452@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Thu, 17 Mar 2005 11:28:49 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j2HHSl0r032651 for ; Thu, 17 Mar 2005 09:28:47 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j2HHSlBR032650 for zsh-workers@sunsite.dk; Thu, 17 Mar 2005 09:28:47 -0800 Date: Thu, 17 Mar 2005 17:28:47 +0000 From: Bart Schaefer Subject: Re: problem redeclaring path variable (ksh incompatibility) In-reply-to: <1050317165007.ZM32408@candle.brasslantern.com> To: zsh-workers@sunsite.dk Message-id: <1050317172847.ZM32649@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <423994CA.4010609@endbracket.net> <1050317165007.ZM32408@candle.brasslantern.com> Comments: In reply to Bart Schaefer "Re: problem redeclaring path variable (ksh incompatibility)" (Mar 17, 4:50pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 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();