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

Re: zcalc bug



On Thu, May 13, 2004 at 03:57:58PM +0100, Peter Stephenson wrote:
> Wayne, have you any idea how easy it would be to implement something
> to make switching history files easy?

I'd like to see something that doesn't involve saving and restoring the
lines of the current history to a file, but instead just shunts aside
the internal data temporarily.  This would be the least disruptive,
especially since some info is lost when it gets written out and re-read
(I'm thinking of the local/imported distinction when sharing history
between multiple shells as at least one such thing that is lost).

A couple different potential idioms for surfacing this to the user come
to mind:

    pushhist; ...; pophist

    setopt localoptions tmphist

Both would do approximately the same thing internally, but I would
assume that a push/pop idiom would be expected to handle more than one
saved history at a time.  Either one would save and restore the history-
related environment variables (like HISTFILE & HISTSIZE) but (I assume)
not any of the history-related options (those a script could set locally
using the already-existing means).

It doesn't seem like it would be too hard to find all the variables that
need to be tweaked (maybe putting them into a single structure) and then
implementing something that can save and restore them under user control.

What do you think?

..wayne..



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