zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: [PATCH] sh/ksh init: don't initialise lowercase parameters
Date: Tue, 28 Jan 2020 15:26:03 +0000	[thread overview]
Message-ID: <1580225163.6442.49.camel@samsung.com> (raw)
In-Reply-To: <b7e2e8a2-87a9-49c9-77ff-e612285b7a30@inlv.org>

On Tue, 2020-01-28 at 16:19 +0100, Martijn Dekker wrote:
> In POSIX sh and in ksh, it's the convention that lowercase variable 
> names are reserved for scripts, and uppercase names may be used by the 
> shell or system. So most lowercase zsh parameters are not initialised 
> when zsh is invoked as sh or ksh (through a symlink or the --emulate 
> option).
> 
> However, there are two left that are initialised in sh/ksh mode: 
> 'histchars' and 'signals'. So this can conflict with POSIX scripts.
> 
> Also, if zsh is invoked as sh or ksh, 'histchars' is available whereas 
> the 'HISTCHARS' equivalent is not. It seems quite obvious that this 
> should be the other way around.
> 
> The attached patch makes zsh, when invoked as sh or ksh, not initialise 
> 'signals', and initialise 'HISTCHARS' instead of 'histchars'. It also 
> updates the documentation.

That sounds fine to me --- as you know, general policy has always been
that emulation modes are there solely for compatibility with other
shells and backward compatibility is irrelevant, whereas native mode
is the other way round.

I'm guessing histchars got that way round in some kind of mistaken
link up with compatibility with csh, which tends to deal only
with lower case variables.  But that's just a guess, don't think
it really matters.

pws


  reply	other threads:[~2020-01-28 15:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200128152042eucas1p20cbbeeb7cbe5f6abff08128ba8792661@eucas1p2.samsung.com>
2020-01-28 15:19 ` Martijn Dekker
2020-01-28 15:26   ` Peter Stephenson [this message]
2020-01-28 15:45     ` Martijn Dekker
2020-01-29  8:49   ` Daniel Shahaf
2020-01-29 18:36     ` Bart Schaefer
2020-01-29 21:35       ` Daniel Shahaf
2020-01-29 22:00         ` Bart Schaefer
2020-01-31  4:17           ` Daniel Shahaf
2020-01-31  4:31             ` Bart Schaefer
2020-02-01  9:42   ` Daniel Shahaf

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=1580225163.6442.49.camel@samsung.com \
    --to=p.stephenson@samsung.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).