zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh workers <zsh-workers@sunsite.dk>
Subject: Re: zkbd fails: must be run as a function or shell script, not sourced
Date: Fri, 14 Mar 2008 19:57:27 +0000	[thread overview]
Message-ID: <20080314195727.50800daa@pws-pc> (raw)
In-Reply-To: <080313162818.ZM21832@torch.brasslantern.com>

On Thu, 13 Mar 2008 16:28:18 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> If you remove the "2>/dev/null" you get the error message:
> 
> zkbd:5: read-only variable: ARGC
> 
>...
> So although I say "lost PM_HIDE", in point of fact I don't know how it
> had PM_HIDE in the first place.

It didn't.  I think the relevant change is this:

@@ -2033,6 +2033,10 @@
 	 * because we've checked for unpleasant surprises above.
 	 */
 	pm->node.flags = (PM_TYPE(pm->node.flags) | on | PM_SPECIAL) & ~off;
+	/*
+	 * Readonlyness of special parameters must be preserved.
+	 */
+	pm->node.flags |= tpm->node.flags & PM_READONLY;
 	if (newspecial == NS_SECONDS) {
 	    /* We save off the raw internal value of the SECONDS var */
 	    tpm->u.dval = getrawseconds();

So what was happening before was that ARGC wasn't being hidden, it was
staying special but was incorrectly being marked as not readonly, which
doesn't make sense since the special meaning is by definition a readonly
one (and goodness knows what effect changing it had).  It seems to me
therefore that adding the "-h" in zkbd is the pukka thing to do.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2008-03-14 19:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 20:27 Frank Terbeck
2008-03-13 20:35 ` Mikael Magnusson
2008-03-13 20:52   ` Frank Terbeck
2008-03-13 23:28 ` Bart Schaefer
2008-03-14 19:57   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080314195727.50800daa@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).