zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Read-only variables in emulation mode
Date: Tue, 16 Jun 2015 02:10:03 +0200	[thread overview]
Message-ID: <CAHYJk3QtwxXabmsuYz_D-EcWSkmhLn_XWkPUnhiOU7VDdZLTPg@mail.gmail.com> (raw)
In-Reply-To: <131218235723.ZM4638@torch.brasslantern.com>

On Thu, Dec 19, 2013 at 8:57 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Dec 18,  7:28pm, Peter Stephenson wrote:
> } Subject: Re: Read-only variables in emulation mode
> }
> } On Tue, 17 Dec 2013 22:36:51 -0800
> } Bart Schaefer <schaefer@brasslantern.com> wrote:
> } > It's a known limitation that invoking "emulate ..." after the shell is
> } > already running does [not] completely re-instantiate POSIX mode.
> }
> } I don't expect I'll get round to it myself, but in the case of
> } variables, I don't think this should be that difficult.
>
> The part about "_" is easy, though:
>
> diff --git a/Src/params.c b/Src/params.c
> index 26ad6b2..cadf268 100644
> --- a/Src/params.c
> +++ b/Src/params.c
> @@ -283,7 +283,7 @@ IPDEF2("TERM", term_gsu, 0),
>  IPDEF2("TERMINFO", terminfo_gsu, PM_UNSET),
>  IPDEF2("WORDCHARS", wordchars_gsu, 0),
>  IPDEF2("IFS", ifs_gsu, PM_DONTIMPORT),
> -IPDEF2("_", underscore_gsu, PM_READONLY),
> +IPDEF2("_", underscore_gsu, PM_DONTIMPORT),
>  IPDEF2("KEYBOARD_HACK", keyboard_hack_gsu, PM_DONTIMPORT),
>
>  #ifdef USE_LOCALE
>
>
> Feel free to commit that for me if you want it to go into 5.0.4, I'm
> going to be asleep for the next several hours ...

% echo hi; _=foo; echo $_
hi
hi

% for _ in a b c; do echo $_ hi; done
hi
hi hi
hi hi

I'm not sure if this is better than printing a warning that $_ is readonly. :)

-- 
Mikael Magnusson


  reply	other threads:[~2015-06-16  0:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 19:10 Øystein Walle
2013-12-16 19:40 ` Bart Schaefer
2013-12-18  6:36   ` Bart Schaefer
2013-12-18 19:28     ` Peter Stephenson
2013-12-19  7:57       ` Bart Schaefer
2015-06-16  0:10         ` Mikael Magnusson [this message]
2015-06-16  3:24           ` Bart Schaefer
2015-06-16  6:24             ` Mikael Magnusson
2015-06-16 15:54               ` Bart Schaefer
2015-06-16 21:06                 ` Mikael Magnusson
2015-06-16 19:05             ` Bart Schaefer

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=CAHYJk3QtwxXabmsuYz_D-EcWSkmhLn_XWkPUnhiOU7VDdZLTPg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).