use expl3 interface of hooks instead

This commit is contained in:
Maximilian Keßler 2022-01-16 18:03:43 +01:00
parent 73d473b25d
commit a8cca1cbc6

View file

@ -6,10 +6,10 @@ __HEADER__(Grouping theorems for easier customization.)
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\NewHook { groupthm / prename }
\NewHook { groupthm / postname }
\NewHook { groupthm / mapname }
\NewHook { groupthm / thmtools }
\hook_new:n { groupthm / prename }
\hook_new:n { groupthm / postname }
\hook_new:n { groupthm / mapname }
\hook_new:n { groupthm / thmtools }
\newcounter{indocument}
@ -88,19 +88,19 @@ __HEADER__(Grouping theorems for easier customization.)
{
\cs_new:cpn { group_use_#1: }
{
\AddToHook { groupthm / prename } [ #1 ]
\hook_gput_code:nnn { groupthm / prename } { #1 }
{
\tl_put_left:Nx \l_groupthm_prename_tl { #2 }
}
\AddToHook { groupthm / postname } [ #1 ]
\hook_gput_code:nnn { groupthm / postname } { #1 }
{
\tl_put_right:Nx \l_groupthm_postname_tl { #3 }
}
\AddToHook { groupthm / mapname } [ #1 ]
\hook_gput_code:nnn { groupthm / mapname } { #1 }
{
\clist_put_right:Nn \l_groupthm_mapname_clist { #4 }
}
\AddToHook { groupthm / thmtools } [ #1 ]
\hook_gput_code:nnn { groupthm / thmtools } { #1 }
{
\clist_put_right:Nn \l_groupthm_thmtools_clist { #5 }
}
@ -154,10 +154,10 @@ __HEADER__(Grouping theorems for easier customization.)
\clist_clear:N \l_groupthm_mapname_clist
\clist_set:Nn \l_groupthm_thmtools_clist { #4 }
\RemoveFromHook { groupthm / prename }[*]
\RemoveFromHook { groupthm / postname }[*]
\RemoveFromHook { groupthm / mapname }[*]
\RemoveFromHook { groupthm / thmtools }[*]
\hook_gremove_code:nn { groupthm / prename }{*}
\hook_gremove_code:nn { groupthm / postname }{*}
\hook_gremove_code:nn { groupthm / mapname }{*}
\hook_gremove_code:nn { groupthm / thmtools }{*}
\clist_map_function:nN { #2 } \group_use:n
\hook_use:n { groupthm / prename }