From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2980 invoked from network); 30 Jul 1999 09:17:42 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jul 1999 09:17:42 -0000 Received: (qmail 12636 invoked by alias); 30 Jul 1999 09:17:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7321 Received: (qmail 12629 invoked from network); 30 Jul 1999 09:17:27 -0000 Message-Id: <9907300846.AA31025@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: unsetopt banghist does not work. In-Reply-To: "Tanaka Akira"'s message of "30 Jul 1999 16:58:47 DFT." Date: Fri, 30 Jul 1999 10:46:23 +0200 From: Peter Stephenson 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 Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy