From 6cfedab7ee4e1c5da78dba4963bf0cb3454f0fa5 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 21 May 2004 20:05:03 +0000 Subject: [PATCH] Use the new `history -ap' command to restore the history instead of using a trap function. --- Functions/Misc/zcalc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Functions/Misc/zcalc b/Functions/Misc/zcalc index d416ade92..67c00fac4 100644 --- a/Functions/Misc/zcalc +++ b/Functions/Misc/zcalc @@ -86,20 +86,13 @@ emulate -L zsh setopt extendedglob -# push to our own history file -fc -p ~/.zcalc_history - -zcalc_restore() { - unfunction zcalc_restore - # pop back to original history - fc -P -} -trap zcalc_restore HUP INT QUIT EXIT - local line ans base defbase forms match mbegin mend psvar optlist opt arg local compcontext="-math-" integer num outdigits outform=1 +# We use our own history file with an automatic pop on exit. +history -ap ~/.zcalc_history + forms=( '%2$g' '%.*g' '%.*f' '%.*E' ) zmodload -i zsh/mathfunc 2>/dev/null