about summary refs log tree commit diff
path: root/Functions/Misc
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2004-05-21 20:05:03 +0000
committerWayne Davison <wayned@users.sourceforge.net>2004-05-21 20:05:03 +0000
commit6cfedab7ee4e1c5da78dba4963bf0cb3454f0fa5 (patch)
treec864ff6ba1916cf83a22b2bb824d2b017b9a5ef3 /Functions/Misc
parentf0742aeaa5ca28ca9680735f2b540c7f8da10df5 (diff)
downloadzsh-6cfedab7ee4e1c5da78dba4963bf0cb3454f0fa5.tar.gz
zsh-6cfedab7ee4e1c5da78dba4963bf0cb3454f0fa5.tar.xz
zsh-6cfedab7ee4e1c5da78dba4963bf0cb3454f0fa5.zip
Use the new `history -ap' command to restore the history instead of
using a trap function.
Diffstat (limited to 'Functions/Misc')
-rw-r--r--Functions/Misc/zcalc13
1 files 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