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

Re: zcalc bug



Thomas =?iso-8859-1?Q?K=F6hler?= wrote:
> print -P %h
> 504
> ~> zcalc
> 1> 1+2+3
> 6
> ~> print -P %h
> 1014

Aha, now I understand.  This much is sufficient to show the problem.
(By pruning it I may have made the numbers inconsistent, though
I think not).  Concise bug reports are a Good Thing.

zcalc switches the history to its own file, then at the end switches
back.  Unfortunately the only way of switching back to the main file at
the end, removing the zcalc stuff, is to read it back in again.  This
overwrites the numbers.

The only obvious alternative is to leave zcalc entries in the main
history, so in the previous example scrolling back from the final prompt
would take you through `print -P %h', `1+2+3', `print -P %h'.  This was
the older (and easier) behaviour.  I decided an attempt to separate the
histories would be better.  This could be configurable, but neither
behaviour is perfect.

There is no direct way of manipulating the history, only reading it and
writing or appending it.  There may be some hack I haven't thought of,
but the history number handling is buried deep inside.

Wayne, have you any idea how easy it would be to implement something to
make switching history files easy?  E.g. could it be just a matter of
resetting history numbers at the right point when reading in?

I have always dreamed of having a way of manipulating the history
directly using variables.  However, given all the features of the
history, this isn't easy to do properly.  I don't have remotely enough
time and there are many higher priority problems.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



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