Skip to content

Commit

Permalink
Add changes.txt and \changes entries
Browse files Browse the repository at this point in the history
  • Loading branch information
PhelypeOleinik committed Sep 6, 2021
1 parent 70912ca commit cb72199
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Expand Up @@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================

2021-08-30 Phelype Oleinik <phelype.oleinik@latex-project.org>

* lthooks.dtx (subsection{Using the hook}):
Clean up after \UseOneTimeHook and prevent a second usage (gh/606).

2021-08-30 Phelype Oleinik <phelype.oleinik@latex-project.org>

* ltcmd.dtx (subsubsection{Copying a command and its internal structure}):
Expand Down
11 changes: 8 additions & 3 deletions base/lthooks.dtx
Expand Up @@ -31,8 +31,8 @@
%%% From File: lthooks.dtx
%
% \begin{macrocode}
\def\lthooksversion{v1.0q}
\def\lthooksdate{2021/08/27}
\def\lthooksversion{v1.0r}
\def\lthooksdate{2021/09/06}
% \end{macrocode}
%
%<*driver>
Expand Down Expand Up @@ -2974,7 +2974,9 @@
\cs_new_protected:Npn \@@_gput_code:nnn #1 #2 #3
{
% \end{macrocode}
% First check if the hook was used as a one-time hook:
% First check if the code should be executed immediately, rather than
% stored:
% \changes{v1.0r}{2021/09/06}{Use dedicated conditional (gh/606)}
% \begin{macrocode}
\@@_if_execute_immediately:nTF {#1}
{#3}
Expand Down Expand Up @@ -4812,6 +4814,7 @@
% hook name, since \cs{hook_use:n} and \cs{hook_use_once:n} are
% documented to not trim spaces.
%
% \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)}
% \begin{macrocode}
\cs_new_protected:Npn \hook_use_once:n #1
{
Expand All @@ -4836,6 +4839,7 @@
% code from being added to the hook. \cs{@@_use_once_clear:n} then
% clears the hook so that any further call to \cs{hook_use:n} or
% \cs{hook_use_once:n} will expand to nothing.
% \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)}
% \begin{macrocode}
\cs_new_protected:Npn \@@_use_once_set:n #1
{ \@@_tl_gset:cn { g_@@_#1_reversed_tl } { I } }
Expand All @@ -4859,6 +4863,7 @@
% \cs[no-index]{g_@@_\meta{hook}_reversed_tl} is |I|. The gymnastics
% around \cs{if:w} is there to allow the |reversed| token list to be
% empty.
% \changes{v1.0r}{2021/09/06}{Macro added (gh/606)}
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { F, TF }
{
Expand Down

0 comments on commit cb72199

Please sign in to comment.