zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint3@fastmail.com>
To: zsh-users@zsh.org
Subject: Set option in parent after emulate -L zsh
Date: Thu, 09 Mar 2017 00:58:56 -0800	[thread overview]
Message-ID: <1489049936.3120661.905537968.237F11E3@webmail.messagingengine.com> (raw)

Hello,
doing:

% unsetopt promptsubst   # Should see garbage in prompt
% () { setopt promptsubst; }

restores correct prompt. Then, to handle emulate -L:

emulate -L zsh
unsetopt promptsubst
() { setopt promptsubst; }   # no change
() { unsetopt localoptions; setopt promptsubst; }   # prompt restored
echo $options[localoptions] $options[promptsubst]   # shows "on on"

I wonder what does the "unsetopt localoptions" do. It connects current
function's level with parent locallevel in context of options, not
harming parent "localoptions" setting? That would be the best
possibility, but I'm afraid something different might be happening
maybe?

-- 
  Sebastian Gniazdowski
  psprint3@fastmail.com


             reply	other threads:[~2017-03-09  8:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09  8:58 Sebastian Gniazdowski [this message]
2017-03-09 22:06 ` Bart Schaefer
2017-03-10  5:47   ` Daniel Shahaf
2017-03-14 19:17   ` Sebastian Gniazdowski
2017-03-14 20:24     ` Bart Schaefer
2017-03-14 20:39       ` Sebastian Gniazdowski

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=1489049936.3120661.905537968.237F11E3@webmail.messagingengine.com \
    --to=psprint3@fastmail.com \
    --cc=zsh-users@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).