activate caching for all Document Commands

This commit is contained in:
Maximilian Keßler 2022-01-31 21:02:48 +01:00
parent bea7380166
commit 48651b4919

View file

@ -1795,7 +1795,10 @@
{ \@@_Declarator: TheoremGroup }
{ O{} m }
{
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 }
\@@_lazy:n
{
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 }
}
}
% \end{macrocode}
% \end{macro}
@ -1850,7 +1853,10 @@
% \begin{macrocode}
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m }
{
\groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
\@@_lazy:n
{
\groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
}
}
% \end{macrocode}
% \end{macro}
@ -1886,7 +1892,10 @@
% \begin{macrocode}
\NewDocumentCommand { \AddTheoremGroupParent } { m m }
{
\groupthm_add_parent:nn { #1 } { #2 }
\@@_lazy:n
{
\groupthm_add_parent:nn { #1 } { #2 }
}
}
% \end{macrocode}
% \end{macro}
@ -1973,7 +1982,9 @@
% \begin{macrocode}
\NewDocumentCommand { \AppendToTheoremGroup } { O{} m }
{
\groupthm_append_to_group:nn { #1 } { #2 }
\@@_lazy:n {
\groupthm_append_to_group:nn { #1 } { #2 }
}
}
% \end{macrocode}
% \end{macro}
@ -2289,13 +2300,7 @@
{ \@@_Declarator: GroupedTheorem }
{ s O{} m }
{
\bool_if:NTF \g_@@_cache_bool
{
\hook_gput_code:nnn {@@/definelazy} { groupthm }
}
{
\use:n
}
\@@_lazy:n
{
\use:c { groupthm_#1_theorem:nnn }
{ ##2 }
@ -2448,10 +2453,13 @@
{ \@@_Declarator: GroupedTheoremFamily }
{ s O{} m }
{
\use:c { groupthm_#1_family:nnn }
{ ##2 }
{ ##3 }
{ ##1 }
\@@_lazy:n
{
\use:c { groupthm_#1_family:nnn }
{ ##2 }
{ ##3 }
{ ##1 }
}
}
% \end{macrocode}
% \end{macro}
@ -2497,9 +2505,12 @@
%
% \begin{macrocode}
\NewDocumentCommand { \AddTheoremToGroup } { m }
{
\groupthm_add_theorem_to_group:n { #1 }
}
{
\@@_lazy:n
{
\groupthm_add_theorem_to_group:n { #1 }
}
}
% \end{macrocode}
% \end{macro}
%
@ -2665,6 +2676,34 @@
%
% \subsection{Caching}
%
%
%
%
%
% \begin{macro}{\@@_lazy:n}
% \begin{syntax}
% \cs{@@_lazy:n}\marg{code}
% \end{syntax}
%
% Executes this code lazy at beginning of the document,
% iff caching is active.
%
% At beginning of document, code will be only executed
% if the aux file version was too old, otherwise dropped.
%
% \begin{macrocode}
\cs_new:Npn \@@_lazy:n
{
\bool_if:NTF \g_@@_cache_bool
{
\hook_gput_code:nnn {@@/definelazy} { groupthm }
}
{
\use:n
}
}
% \end{macrocode}
% \end{macro}
%
%
%