Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: unsetopt banghist does not work.



On Jul 30,  7:44pm, Tanaka Akira wrote:
} Subject: Re: unsetopt banghist does not work.
}
} In article <9907300846.AA31025@xxxxxxxxxxxxxxxxx>,
}   Peter Stephenson <pws@xxxxxxxxxxxxxxxxx> writes:
} > 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
} 
} This behaviour is different to zsh-3.1.5-pws-21 and zsh-3.1.5.

The problem is with this change:

  Sven: 6542, 6551: Don't buffer in the history code any text that won't
  be added to the history.

This was done to speed up sourcing of files and execution of functions, but
it has the side-effect of causing the history to be discarded completely
when NOBANGHIST is in effect; or at least it has that effect when combined
with PWS's patch of 7324.  Obviously this is unacceptable -- it means that
"unsetopt banghist" also disables the zle history operations.

I think the following is the right fix.  It goes on top of 7324.  There
probably ought to be some #define constants for this instead of numbers.

Index: Src/hist.c
===================================================================
@@ -722,7 +722,7 @@
 	hwend = ihwend;
 	addtoline = iaddtoline;
 	if (!isset(BANGHIST))
-	    stophist = 2;
+	    stophist = 4;
     }
     chwordpos = 0;
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author