On Fri, May 14, 2004 at 10:23:45AM +0100, Peter Stephenson wrote: > This would definitely be nice to have. OK, I created an initial implementation of this today (it was pretty easy, as I expected). See if you like it. It works in my limited testing (i.e. a modified zcalc works quite nicely), but I may have missed something. > Do you think it's easy to keep the state of external files consistent > while you do that? I'm not sure what you mean by this. My code isn't doing anything with files, so the modified zcalc function still loads the .zcalc_history file with "fc -R" and its restore function writes it out with "fc -W". However, no fc calls are needed to save and restore the current history. It would be possible to change my current, very simple pushhist/pophist syntax to have pushhist optionally take some parameters to setup the new history environment, for instance: pushhist 200 100 ~/.zcalc_history would be just like this shell code: pushhist HISTSIZE=200 SAVEHIST=100 HISTFILE=~/.zcalc_history [[ -f $HISTFILE ]] && fc -R And the pophist function could likewise be changed to work like this: [[ ! -z $HISTFILE && $SAVEHIST > 0 ]] && fc -W pophist (Although maybe that should be "pophist -W" or something.) However, that may be overkill since it is so easy to code up those extra few shell lines. Appended is my patch. ..wayne..