Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Read-only variables in emulation mode
- X-seq: zsh-workers 35479
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Read-only variables in emulation mode
- Date: Tue, 16 Jun 2015 02:10:03 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RkUCquy0E8RlLtkC2AxCTqkwm3UJquJxmPoS2n3MFU0=; b=CSXbfOulHDF5cuKlpTHPBdT27KqAU8vSDDJ4/dnMPyjVzbPx3kWDV+ez9KKGYzl5eP NbSIlzsNnsjClYIKapZf2Y64bgi6U877OIUvfSHbRCzQ5ZxhLLVdUWo3H74xjU6VOXcg HJbLHHHEVwrsoALOnyleRSJ6KbLqIhLHAAcAn0nxVlXXBD6s7az+q05bI27kiamkKtPM Ma/WLcD1m+y1zy07lX/l5uNt08VyyGjJRPUijOJ4YwPW4iPj/xhvvp7E79S+hT5YPEZy OY++wzbHcqzd/YZxkJSowjN3HWQGJF/pWHUIZRYLX9OAYzc5+SU2NQ257uxp697G6qTF 6xKQ==
- In-reply-to: <131218235723.ZM4638@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAFaJEqs=P7yB-VGk=gJB2jzRf7zNiDkCuWWRADyY_xb52hGb_w@mail.gmail.com> <131216114013.ZM25877@torch.brasslantern.com> <131217223651.ZM20980@torch.brasslantern.com> <20131218192816.047ab5f5@pws-pc.ntlworld.com> <131218235723.ZM4638@torch.brasslantern.com>
On Thu, Dec 19, 2013 at 8:57 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author