zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@candle.brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: Minor patch to 3.0.4 for ALWAYS_LAST_PROMPT
Date: Fri, 27 Jun 1997 22:48:56 -0700	[thread overview]
Message-ID: <199706280548.WAA00051@candle.brasslantern.com> (raw)

I'm sure I sent some mail about this quite a while ago -- probably
back in February, judging by the edit dates on some files.

The manual entry for ALWAYS_LAST_PROMPT says:

                     If  unset,  key  functions that list comple-
                     tions try to return to the  last  prompt  if
                     given a numeric argument. If set these func-
                     tions try to return to the  last  prompt  if
                     given no numeric argument.

What the code does, however, is act this way if an argument *other*
*than 1* is given.  That is, ESC 2 ... or even ESC 0 ... produces the
desired effect, but ESC 1 ... does not.

The fix is to look at `gotmult', rather than comparing `zmult' to 1.
Here's a patch against 3.0.4; I don't know where it applies to 3.1.x.

Index: Src/zle_main.c
===================================================================
--- zle_main.c	1997/06/27 18:37:06	1.1.1.4
+++ zle_main.c	1997/06/28 05:20:02	1.4
@@ -1110,8 +1110,8 @@
 	return;
     trashzle();
     clearflag = (isset(USEZLE) && !termflags &&
-		 (isset(ALWAYSLASTPROMPT) && zmult == 1)) ||
-	(unset(ALWAYSLASTPROMPT) && zmult != 1);
+		 (isset(ALWAYSLASTPROMPT) && !gotmult)) ||
+	(unset(ALWAYSLASTPROMPT) && gotmult);
     printbind(keybuf, (len = strlen(keybuf)) ? len : 1, 0);
     fprintf(shout, " is ");
     if (cmd == z_sendstring) {
@@ -1157,8 +1157,8 @@
     funcfound = 0;
     trashzle();
     clearflag = (isset(USEZLE) && !termflags &&
-		 (isset(ALWAYSLASTPROMPT) && zmult == 1)) ||
-	(unset(ALWAYSLASTPROMPT) && zmult != 1);
+		 (isset(ALWAYSLASTPROMPT) && !gotmult)) ||
+	(unset(ALWAYSLASTPROMPT) && gotmult);
     if (func == z_selfinsert || func == z_undefinedkey)
 	fprintf(shout, "%s is on many keys", zlecmds[func].name);
     else {
Index: Src/zle_tricky.c
===================================================================
--- zle_tricky.c	1997/06/27 18:37:07	1.1.1.4
+++ zle_tricky.c	1997/06/28 05:20:16	1.4
@@ -2146,8 +2146,8 @@
 	    trashzle();
 
 	    clearflag = (isset(USEZLE) && !termflags &&
-			 (isset(ALWAYSLASTPROMPT) && zmult == 1)) ||
-			(unset(ALWAYSLASTPROMPT) && zmult != 1);
+			 (isset(ALWAYSLASTPROMPT) && !gotmult)) ||
+			(unset(ALWAYSLASTPROMPT) && gotmult);
 
 	    up = printfmt(expl, nmatches, 1);
 
@@ -3519,8 +3519,8 @@
     showinglist = 0;
 
     clearflag = (isset(USEZLE) && !termflags &&
-		 (isset(ALWAYSLASTPROMPT) && zmult == 1)) ||
-	(unset(ALWAYSLASTPROMPT) && zmult != 1);
+		 (isset(ALWAYSLASTPROMPT) && !gotmult)) ||
+	(unset(ALWAYSLASTPROMPT) && gotmult);
 
     arr = amatches;
 


                 reply	other threads:[~1997-06-28  5:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=199706280548.WAA00051@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=schaefer@zanshin.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).