summaryrefslogtreecommitdiff
path: root/metapost/context/base/mpiv/mp-mlib.mpiv
diff options
context:
space:
mode:
Diffstat (limited to 'metapost/context/base/mpiv/mp-mlib.mpiv')
-rw-r--r--metapost/context/base/mpiv/mp-mlib.mpiv10
1 files changed, 9 insertions, 1 deletions
diff --git a/metapost/context/base/mpiv/mp-mlib.mpiv b/metapost/context/base/mpiv/mp-mlib.mpiv
index c79cb4870..a6ac3db3f 100644
--- a/metapost/context/base/mpiv/mp-mlib.mpiv
+++ b/metapost/context/base/mpiv/mp-mlib.mpiv
@@ -190,8 +190,16 @@ extra_beginfig := extra_beginfig & "mfun_reset_tex_texts ;" ;
% and once at the end because we need to flush missing ones.
boolean mfun_onetime_textext ; mfun_onetime_textext := false ;
+numeric mfun_global_textext ; mfun_global_textext := 0 ;
-def notcached = withprescript "tx_cache=no" enddef ;
+def keepcached =
+ hide(mfun_global_textext := mfun_global_textext + 1;)
+ withprescript ("tx_cache=" & decimal mfun_global_textext)
+enddef ;
+
+def notcached =
+ withprescript "tx_cache=no"
+enddef ;
% todo: onetime