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

Re: spaceflag question; remhist() going away



Wayne wrote:
> There's a variable that gets set in input.c called "spaceflag".  It
> gets set if the first character of the first line is a space.  Later
> on, the history code checks this flag when the HIST_IGNORE_SPACE
> option is set.  Can anyone tell me why the history code doesn't just
> check if (*chline == ' ') instead of checking spaceflag?
... 
> In a related area, I've dumped the function remhist() in my local
> source.  This function is a constant source of bugs, and I found
> yet another bug today:  if you have HIST_IGNORE_SPACE set along
> with HIST_NO_STORE, you lose a line of history every time you type
> " history" (note the leading space).

The history of history is hidden in prehistory.  It's probably best to
remove this stuff and then fix the problems which turn up later.  I've
always hated remhist() and have fixed at least two bugs in it without
counting everyone else's.

One possible reason for spaceflag might be that originally zsh kept lexical
and literal history separately so might not have known if the first word
began with a space.  But as far as I know chline has always been there, so
that's probably wrong.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



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