zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 4.0.2: rprompt2 variable
@ 2002-01-25 12:48 Derek Peschel
  2002-01-29 18:21 ` Oliver Kiddle
  0 siblings, 1 reply; 5+ messages in thread
From: Derek Peschel @ 2002-01-25 12:48 UTC (permalink / raw)
  To: zsh-workers

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) <S>)
+vindex(RPS2)
+item(tt(RPS2) <S>)(
+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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-01-31 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25 12:48 PATCH: 4.0.2: rprompt2 variable Derek Peschel
2002-01-29 18:21 ` Oliver Kiddle
2002-01-31  5:01   ` Derek Peschel
2002-01-31 14:12     ` Oliver Kiddle
2002-01-31 12:06   ` Peter Stephenson

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).