From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4393 invoked by alias); 29 Apr 2015 11:09:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34995 Received: (qmail 21833 invoked from network); 29 Apr 2015 11:09:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-f794b6d000001495-81-5540bbd9f15a Date: Wed, 29 Apr 2015 12:09:04 +0100 From: Peter Stephenson To: zsh workers Subject: Local readonly specials (was: Can't mark unset variables as read-only) Message-id: <20150429120904.03d21689@pwslap01u.europe.root.pri> In-reply-to: References: <55407BBF.6020401@inlv.org> <20150429113602.374240c7@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsVy+t/xK7o3dzuEGnw+rGxxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mqb8nc1asI2tovf1VbYGxk7WLkZODgkBE4mmRyuhbDGJC/fW s3UxcnEICSxllGhbOZMRwpnBJLFxwVkmCGcbo8SR7tlsIC0sAqoSP+5uYQex2QQMJaZums0I YosAxZu//2MBsYUFAiQuTvsMVsMrYC/xvfEZE4jNKRAsce3eHWaIoUsYJbbfnQ52B7+AvsTV v5+YIG6yl5h55QwjRLOgxI/J98CGMgtoSWze1sQKYctLbF7zlhnEFhJQl7hxdzf7BEahWUha ZiFpmYWkZQEj8ypG0dTS5ILipPRcI73ixNzi0rx0veT83E2MkMD9uoNx6TGrQ4wCHIxKPLwS Jg6hQqyJZcWVuYcYJTiYlUR4j24DCvGmJFZWpRblxxeV5qQWH2KU5mBREueduet9iJBAemJJ anZqakFqEUyWiYNTqoGxxV1t+RbGnq/tPS2rnwn5HT2eckT6/rUIbX7HSoPpzLtSlju3tgcr /pkiv8DnzA+JqMiM8r37qj71bJ0oxJSRJ1PjGcuxg9eWeZ7F/Df/BSPz3Z5c7c37EahrbHkv fUrRb/uybOnz1WsLc1r8Tu6SEaoyf1qzsuDA/Mn2K/N8w/U1xMVfbFJiKc5INNRiLipOBACd yL2JWAIAAA== On Wed, 29 Apr 2015 12:57:29 +0200 Mikael Magnusson wrote: > I wanted the opposite thing the other day, sort of. I have a ZLE > widget that looks at $WIDGET, and I wanted to reuse it by calling it > from another widget, setting WIDGET to another value first. However, > ZLE makes $WIDGET readonly special, and I couldn't find any > combination of flags that let me make a non-readonly local WIDGET. Is > that possible? Not sure what's going on here, since this usually works: % typeset -r PATH % PATH=foo zsh: read-only variable: PATH % fn() { typeset -h PATH=foo; print $PATH; } % fn foo % typeset +r PATH typeset: PATH: can't change type of a special parameter See if you can make the existing WIDGET hidden (typeset -gh WIDGET?) before you create a local variable? pws