From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1472 invoked from network); 25 Jan 2002 12:48:21 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Jan 2002 12:48:21 -0000 Received: (qmail 10614 invoked by alias); 25 Jan 2002 12:48:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16492 Received: (qmail 10602 invoked from network); 25 Jan 2002 12:48:12 -0000 Date: Fri, 25 Jan 2002 04:48:08 -0800 From: Derek Peschel To: zsh-workers@sunsite.dk Subject: PATCH: 4.0.2: rprompt2 variable Message-ID: <20020125044808.C7661@eskimo.eskimo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Even if a feature (right-hand prompts) is frivolous, it might as well be available in general. Now you can see the parser state (or whatever else you might want to put in PROMPT2) and still have a consistent left margin when entering a multi- line command. See my companion "reverse parser state" patch if you want the parser state to expand leftward on your screen. Comments welcome (I just started using zsh and I have no idea if anyone else will find these patches useful). -- Derek --- Src/params.c.orig Thu Jan 24 15:23:36 2002 +++ Src/params.c Thu Jan 24 18:33:52 2002 @@ -65,6 +65,7 @@ *prompt4, /* $PROMPT4 */ *readnullcmd, /* $READNULLCMD */ *rprompt, /* $RPROMPT */ + *rprompt2, /* $RPROMPT2 */ *sprompt, /* $SPROMPT */ *wordchars, /* $WORDCHARS */ *zsh_name; /* $ZSH_NAME */ @@ -193,12 +194,14 @@ IPDEF7("NULLCMD", &nullcmd), IPDEF7("POSTEDIT", &postedit), IPDEF7("READNULLCMD", &readnullcmd), -IPDEF7("RPROMPT", &rprompt), IPDEF7("PS1", &prompt), +IPDEF7("RPS1", &rprompt), +IPDEF7("RPROMPT", &rprompt), IPDEF7("PS2", &prompt2), +IPDEF7("RPS2", &rprompt2), +IPDEF7("RPROMPT2", &rprompt2), IPDEF7("PS3", &prompt3), IPDEF7("PS4", &prompt4), -IPDEF7("RPS1", &rprompt), IPDEF7("SPROMPT", &sprompt), IPDEF7("0", &argzero), --- Src/input.c.orig Thu Jan 24 15:38:18 2002 +++ Src/input.c Thu Jan 24 18:33:53 2002 @@ -222,8 +222,11 @@ /* If reading code interactively, work out the prompts. */ if (interact && isset(SHINSTDIN)) { - if (!isfirstln) + if (!isfirstln) { ingetcpmptl = prompt2; + if (rprompt2) + ingetcpmptr = rprompt2; + } else { ingetcpmptl = prompt; if (rprompt) --- Doc/Zsh/params.yo.orig Thu Jan 24 19:33:03 2002 +++ Doc/Zsh/params.yo Thu Jan 24 19:34:34 2002 @@ -955,6 +955,15 @@ This does not work if the tt(SINGLELINEZLE) option is set. It is expanded in the same way as tt(PS1). ) +vindex(RPROMPT2) +xitem(tt(RPROMPT2) ) +vindex(RPS2) +item(tt(RPS2) )( +This prompt is displayed on the right-hand side of the screen +when the secondary prompt is being displayed on the left. +This does not work if the tt(SINGLELINEZLE) option is set. +It is expanded in the same way as tt(PS2). +) vindex(SAVEHIST) item(tt(SAVEHIST))( The maximum number of history events to save in the history file.