zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Eric Blake <eblake@redhat.com>, zsh-workers@zsh.org
Subject: Re: avoid $status and $options in POSIX mode
Date: Fri, 17 Sep 2010 20:25:10 -0700	[thread overview]
Message-ID: <100917202510.ZM32292@torch.brasslantern.com> (raw)
In-Reply-To: <4C93A654.90807@redhat.com>

On Sep 17, 11:33am, Eric Blake wrote:
} Subject: avoid $status and $options in POSIX mode
}
} Yet, the existence of zsh-magic variables like $status and $options 
} infringe upon the right of a user's script to use this namespace for 
} their own desires.  For example, see this recent autoconf patch:
} http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=23a2c336

That patch is incorrect (or maybe only partly correct).  The "options"
variable is only defined if the zsh/parameter module has been loaded,
which it won't be when the shell is started as "sh".  The "status"
variable is also disabled when the shell is started as "sh".

If autoconf is running into problems with $options, the maintainers
need to find out why zsh/parameter is being loaded in the first place.
Is the shell run by the name "zsh" and *then* switched to emulation?
In that event, module autoloads will still be in effect, so $options
will load itself.

The zsh manual says:

In `sh' and `ksh' compatibility modes the following parameters are not
special and not initialized by the shell: ARGC, argv, cdpath, fignore,
fpath, HISTCHARS, mailpath, MANPATH, manpath, path, prompt, PROMPT,
PROMPT2, PROMPT3, PROMPT4, psvar, status, watch.

} It would be really nice if 'emulate sh' could disable zsh magic handling 
} of any variables that infringe upon the lower-case namespace reserved 
} for applications.

Starting the shell as zsh and then running "emulate" is not the same as
compatibility mode, and is unlikely ever to be; "emulate" is meant to
switch back and forth with minimal loss of state, not to entirely wipe
the slate and become another shell.


  reply	other threads:[~2010-09-18  3:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17 17:33 Eric Blake
2010-09-18  3:25 ` Bart Schaefer [this message]
2010-09-18  7:25   ` Bart Schaefer
2010-09-19 21:39     ` Bart Schaefer
2010-09-20  8:45       ` Peter Stephenson

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=100917202510.ZM32292@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=eblake@redhat.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).