summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-vis.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/trac-vis.mkiv')
-rw-r--r--tex/context/base/trac-vis.mkiv37
1 files changed, 34 insertions, 3 deletions
diff --git a/tex/context/base/trac-vis.mkiv b/tex/context/base/trac-vis.mkiv
index f7559932c..4990913d7 100644
--- a/tex/context/base/trac-vis.mkiv
+++ b/tex/context/base/trac-vis.mkiv
@@ -36,6 +36,9 @@
\unprotect
+\newconstant\c_syst_visualizers_state
+\newtoks \t_syst_visualizers_optimize
+
\definesystemattribute[visual][public,global]
%D We only provide box visualizers as they can come in handy for testing
@@ -50,6 +53,27 @@
\unexpanded\def\ruledvtop{\syst_visualizers_vtop attr \visualattribute \ctxcommand{visual("simplevtop")} } % special case
\unexpanded\def\ruledtopv{\syst_visualizers_vtop attr \visualattribute \ctxcommand{visual("vtop")} }
+\appendtoks
+ \ifcase\c_syst_visualizers_state\else
+ \syst_visualizers_speedup
+ \fi
+\to \everyshipout
+
+\appendtoks
+ \global\let\syst_visualizers_speedup\relax
+\to \t_syst_visualizers_optimize
+
+\def\syst_visualizers_speedup{\the\t_syst_visualizers_optimize}
+
+\appendtoks
+ \normalexpanded {%
+ \unexpanded\xdef\ruledhbox\expandafter{\ruledhbox}%
+ \unexpanded\xdef\ruledvbox\expandafter{\ruledvbox}%
+ \unexpanded\xdef\ruledvtop\expandafter{\ruledvtop}%
+ \unexpanded\xdef\ruledtopv\expandafter{\ruledtopv}%
+ }%
+\to \t_syst_visualizers_optimize
+
\unexpanded\def\showmakeup
{\ctxcommand{setvisual("makeup")}%
\let\normalvtop\ruledtopv
@@ -110,10 +134,17 @@
% \def\spac_struts_vide_hbox
% {\hbox attr \visualattribute \ctxcommand{visual("strut")} }
+%
+% \def\spac_struts_vide_hbox
+% {\xdef\spac_struts_vide_hbox{\hbox attr \visualattribute \ctxcommand{visual("strut")} }%
+% \spac_struts_vide_hbox}
+
+\unexpanded\def\spac_struts_vide_hbox
+ {\hbox attr \visualattribute \ctxcommand{visual("strut")} }
-\def\spac_struts_vide_hbox
- {\edef\spac_struts_vide_hbox{\hbox attr \visualattribute \ctxcommand{visual("strut")} }%
- \spac_struts_vide_hbox}
+\appendtoks
+ \normalexpanded{\unexpanded\xdef\spac_struts_vide_hbox\expandafter{\spac_struts_vide_hbox}}%
+\to \t_syst_visualizers_optimize
%D For manuals: