From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15151 invoked by alias); 29 Jun 2012 10:09:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30546 Received: (qmail 16300 invoked from network); 29 Jun 2012 10:09:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) 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 :content-type; bh=u9pIdcOLMZnUlnfHky1vp9g6F8/9v86zXAN4IvYMeI4=; b=YaY1DzZJcy/dJktN4MLReMdN62Gwl/tRrbfz93C0jWlCx46DQEdE1cUnFcJwTnkCQA 9sszSfDrFfvi8mXG38EaNbDPmYInUTd6biLXdghMkrPd0HqHv4X3sgtZ05xnjWfdqzha UCKD46QxdRQVSBbCIIFMPksMGLAlo80OOwhsSAPnq4jLntLeuV4bVZ9ol0YC+/e4Qd2D qjkNw2oUnidE8i/TiIhFpCAP1ZG9frrFy0ZdlRT3DtVmTpU45IHnD6XVu9qNRodr6gWA 6w2l84gW3SA1PwK8X/hC9GjLKA5ALmhjyvcBUs+3YxkJxaOay43Zl9lEoTAvo4R4Q2uU 6MGg== MIME-Version: 1.0 In-Reply-To: <20120629094045.GA96213@redoubt.spodhuis.org> References: <20120629094045.GA96213@redoubt.spodhuis.org> Date: Fri, 29 Jun 2012 12:02:13 +0200 Message-ID: Subject: Re: 4.3.17 unset RPS1 vs RPROMPT From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 29/06/2012, Phil Pennock 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