zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk
Subject: Re: unsetopt banghist does not work.
Date: Fri, 30 Jul 1999 10:46:23 +0200	[thread overview]
Message-ID: <9907300846.AA31025@ibmth.df.unipi.it> (raw)
In-Reply-To: "Tanaka Akira"'s message of "30 Jul 1999 16:58:47 DFT." <rsq1zdqfu14.fsf@crane.jaist.ac.jp>

Tanaka Akira wrote:
> I found a problem about banghist.
> 
> Z(2):akr@is27e1u11% zsh-3.1.6-test-3 -f
> is27e1u11% unsetopt banghist
> is27e1u11% echo !!
> echo unsetopt banghist
> unsetopt banghist
> is27e1u11% 
> 
> pws-21 works well, but pws-22 has same behaviour to test-3.

I searched for BANGHIST in the archive, but I couldn't find the relevant
change, the last one is 6542, but there must be one later --- is it
working?

The following ought to work (the first hunk is just because the logic
confused me), but could everybody please try this on the favourite mode of
history usage.  Judging by the fact that it's been there for weeks, nobody
uses nobanghist anyway.

This had better be the last major bug.

I suppose I'm going to be told the following is just how history is
supposed to work?

  % unsetopt banghist
  % echo !!
  !!
  % setopt banghist
  % !!
  zsh: no such word in event

(it recovers after that).

--- Src/hist.c~	Mon Jul 19 17:43:17 1999
+++ Src/hist.c	Fri Jul 30 10:27:17 1999
@@ -700,7 +700,7 @@
 {
     isfirstln = isfirstch = 1;
     errflag = histdone = spaceflag = 0;
-    stophist = (dohist ? ((!interact || unset(SHINSTDIN)) << 1) : 2);
+    stophist = (!dohist || !interact || unset(SHINSTDIN)) ? 2 : 0;
     if (stophist == 2 || (inbufflags & INP_ALIAS)) {
 	chline = hptr = NULL;
 	hlinesz = 0;
@@ -721,6 +721,8 @@
 	hwbegin = ihwbegin;
 	hwend = ihwend;
 	addtoline = iaddtoline;
+	if (!isset(BANGHIST))
+	    stophist = 2;
     }
     chwordpos = 0;
 

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-07-30  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-30  7:58 Tanaka Akira
1999-07-30  8:46 ` Peter Stephenson [this message]
1999-07-30 10:44   ` Tanaka Akira
1999-07-31  4:41     ` Bart Schaefer
1999-07-31  4:47       ` Bart Schaefer

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=9907300846.AA31025@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).