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 } { \@@_Declarator: TheoremGroup }
{ O{} m } { O{} m }
{ {
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 } \@@_lazy:n
{
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 }
}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1850,7 +1853,10 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m } \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{macrocode}
% \end{macro} % \end{macro}
@ -1886,7 +1892,10 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand { \AddTheoremGroupParent } { m m } \NewDocumentCommand { \AddTheoremGroupParent } { m m }
{ {
\groupthm_add_parent:nn { #1 } { #2 } \@@_lazy:n
{
\groupthm_add_parent:nn { #1 } { #2 }
}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -1973,7 +1982,9 @@
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand { \AppendToTheoremGroup } { O{} m } \NewDocumentCommand { \AppendToTheoremGroup } { O{} m }
{ {
\groupthm_append_to_group:nn { #1 } { #2 } \@@_lazy:n {
\groupthm_append_to_group:nn { #1 } { #2 }
}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -2289,13 +2300,7 @@
{ \@@_Declarator: GroupedTheorem } { \@@_Declarator: GroupedTheorem }
{ s O{} m } { s O{} m }
{ {
\bool_if:NTF \g_@@_cache_bool \@@_lazy:n
{
\hook_gput_code:nnn {@@/definelazy} { groupthm }
}
{
\use:n
}
{ {
\use:c { groupthm_#1_theorem:nnn } \use:c { groupthm_#1_theorem:nnn }
{ ##2 } { ##2 }
@ -2448,10 +2453,13 @@
{ \@@_Declarator: GroupedTheoremFamily } { \@@_Declarator: GroupedTheoremFamily }
{ s O{} m } { s O{} m }
{ {
\use:c { groupthm_#1_family:nnn } \@@_lazy:n
{ ##2 } {
{ ##3 } \use:c { groupthm_#1_family:nnn }
{ ##1 } { ##2 }
{ ##3 }
{ ##1 }
}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
@ -2497,9 +2505,12 @@
% %
% \begin{macrocode} % \begin{macrocode}
\NewDocumentCommand { \AddTheoremToGroup } { m } \NewDocumentCommand { \AddTheoremToGroup } { m }
{ {
\groupthm_add_theorem_to_group:n { #1 } \@@_lazy:n
} {
\groupthm_add_theorem_to_group:n { #1 }
}
}
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
@ -2665,6 +2676,34 @@
% %
% \subsection{Caching} % \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}
% %
% %
% %