zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: 4.3.17 unset RPS1 vs RPROMPT
Date: Fri, 29 Jun 2012 12:02:13 +0200	[thread overview]
Message-ID: <CAHYJk3T_GtQiX0mrvwuwKVgee6cx4X6JcwobgA5hG+YJ=E1P2Q@mail.gmail.com> (raw)
In-Reply-To: <20120629094045.GA96213@redoubt.spodhuis.org>

On 29/06/2012, Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> wrote:
> zsh 4.3.17, multiple OSes.
>
> Using "prompt walters", I get a green right-prompt.
> Using "prompt pdp" to invoke my own setup, I still have it.
> I debug.  I have "unset RPS1" in my setup function.
> Strange, try at command-line.
>
>  unset RPS1       # no effect
>  unset RPROMPT    # works
>
> I see Src/params.c:
> IPDEF7("RPS1", &rprompt),
> IPDEF7("RPROMPT", &rprompt),
>
> and I know that the docs claim them equivalent.
>
> So try with "zsh -f", and it works.  Some debugging later, and I find
> that if I "unset RPS1" then "typeset -p RPS1 RPROMPT" shows just
> RPROMPT, not both.  If I then call "prompt walters", then RPROMPT will
> be set and can only be cleared with "unset RPROMPT".
>
> If I also "unset RPROMPT", then it comes back into being as a magic
> variable during prompt setup.  If I assign to RPS1, then it too comes
> back as a magic variable bound to the same internal rprompt.
>
> Is it expected that RPROMPT and RPS1 can be decoupled in this way?
> Is there a correct way to clear the prompt, other than *always* having
> to do "unset RPROMPT RPS1" because one or the other may have become
> decoupled?
>
> I don't see it documented and it seems very strange to me.  I'd expect
> that if one is unset, the rprompt content gets unset, but assigning to
> either would instantiate the other again, since it can't be reused by a
> user anyway -- if they unset and then assign to a new value, it still
> changes the same C level "rprompt" variable.
>
> Thoughts?

Does it help if you remove the 'export's in prompt_walters_setup?

-- 
Mikael Magnusson


  reply	other threads:[~2012-06-29 10:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29  9:40 Phil Pennock
2012-06-29 10:02 ` Mikael Magnusson [this message]
2012-06-29 13:32   ` Phil Pennock
2012-06-29 17:35 ` Bart Schaefer
2012-06-29 18:52 ` Peter Stephenson
2012-06-30  5:05   ` Phil Pennock
2012-06-30 17:31     ` Bart Schaefer
2012-07-01 17:39     ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2007-05-03  5:39 [PATCH] Proposal: stat -> zstat Phil Pennock
2007-05-03  8:50 ` Peter Stephenson
2007-05-06  1:07   ` Phil Pennock
2007-05-06 11:57     ` Peter Stephenson
2007-05-06 14:00       ` Phil Pennock
2007-05-07  0:58         ` Peter Stephenson
2007-05-03 14:48 ` Bart Schaefer
2007-05-03 15:46   ` Peter Stephenson
2007-05-07  5:31     ` Bart Schaefer
2007-05-08 14:40       ` Peter Stephenson
2007-05-09 17:19         ` Bart Schaefer
2007-05-09 17:47           ` 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='CAHYJk3T_GtQiX0mrvwuwKVgee6cx4X6JcwobgA5hG+YJ=E1P2Q@mail.gmail.com' \
    --to=mikachu@gmail.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).