[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Other minor doc fixes (c832f542)

PhelypeOleinik phelype.oleinik at latex-project.org
Thu Dec 17 05:06:38 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/c832f542d0b14b9ebee3f6837b04efe69285f901

>---------------------------------------------------------------

commit c832f542d0b14b9ebee3f6837b04efe69285f901
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Thu Dec 17 01:06:38 2020 -0300

    Other minor doc fixes


>---------------------------------------------------------------

c832f542d0b14b9ebee3f6837b04efe69285f901
 base/lthooks.dtx | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 30a7292b..5603d4e6 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -236,10 +236,10 @@
 %    \meta{label}, first apply \cs{RemoveFromHook}.
 %
 %    The hook doesn't have to exist for code to be added to
-%    it. However, if it is not declared later then obviously the
+%    it. However, if it is not declared, then obviously the
 %    added \meta{code} will never be executed.  This
 %    allows for hooks to work regardless of package loading order and
-%    enables packages to add to hook of other packages without
+%    enables packages to add to hooks from other packages without
 %    worrying whether they are actually used in the current document.
 %    See section~\ref{sec:querying}.
 %
@@ -273,7 +273,7 @@
 % \medskip
 %
 % In contrast to the \texttt{voids} relationship between two labels
-% in a \cs{DeclareHookrule} this is a destructive operation as the
+% in a \cs{DeclareHookRule} this is a destructive operation as the
 % labeled code is removed from the hook data structure, whereas the
 % relationship setting can be undone by providing a different
 % relationship later.
@@ -367,7 +367,8 @@
 % token, a low-level \TeX{} error is raised (namely, the \meta{hook} is
 % expanded using \TeX's \cs{csname}\ldots\cs{endcsname}, as such,
 % Unicode characters are allowed in \meta{hook} and \meta{label}
-% arguments).  The arguments of \cs{UseHook} and \cs{UseOneTimeHook} are
+% arguments).  The arguments of \cs{UseHook}, \cs{UseOneTimeHook},
+% \cs{IfHookEmptyTF}, and \cs{IfHookExistsTF} are
 % processed much in the same way except that spaces are not trimmed
 % around the argument, for better performance.
 %
@@ -377,7 +378,7 @@
 % chunk and to prevent clashes.  This should be the standard practice,
 % so this hook management code provides a shortcut to refer to the
 % current package in the name of a \meta{hook} and in a \meta{label}.
-% If \meta{hook} name or \meta{label} consist just of a single dot
+% If the \meta{hook} name or the \meta{label} consist just of a single dot
 % (|.|), or starts with a dot followed by a slash (|./|) then the dot
 % denotes the \meta{default label} (usually the current package or class
 % name---see~\cs{SetDefaultHookLabel}).
@@ -411,7 +412,7 @@
 % exceptions---see \cs{PushDefaultHookLabel}.
 %
 % This syntax is available in all \meta{label} arguments and most
-% \meta{hook}, both in the \LaTeXe{} interface, and the \LaTeX3
+% \meta{hook} arguments, both in the \LaTeXe{} interface, and the \LaTeX3
 % interface described in section~\ref{sec:l3hook-interface}.
 %
 % Note, however, that the replacement of |.| by the \meta{default label}
@@ -525,7 +526,7 @@
 % \subsubsection{Defining relations between hook code}
 %
 % The default assumption is that code added to hooks by different
-% packages is independent and the order in which it is executed is
+% packages are independent and the order in which they are executed is
 % irrelevant. While this is true in many case it is  obviously false
 % in many others.
 %
@@ -664,7 +665,8 @@
 % its permanent code pool, or to its ``next'' token list.  The hook
 % doesn't need to be declared to have code added to its code pool.
 % A hook is said to exist when it was declared with \cs{NewHook} or
-% some variant thereof.
+% some variant thereof.  Generic \hook{file} and \hook{env} hooks are
+% automatically declared when code is added to them.
 %
 % \begin{function}[EXP]{\IfHookEmptyTF}
 %   \begin{syntax}
@@ -838,8 +840,9 @@
 % \begin{function}
 %   {\hook_new:n,\hook_new_reversed:n,\hook_new_pair:nn}
 %   \begin{syntax}
-%     \cs{hook_new:n}\Arg{hook}
-%     \cs{hook_new_pair:nn}\Arg{hook-1}\Arg{hook-2}
+%     \cs{hook_new:n} \Arg{hook}
+%     \cs{hook_new_reversed:n} \Arg{hook}
+%     \cs{hook_new_pair:nn} \Arg{hook-1} \Arg{hook-2}
 %   \end{syntax}
 %   Creates a new \meta{hook} with normal or reverse ordering of code
 %    chunks. \cs{hook_new_pair:nn} creates a pair of such hooks with
@@ -871,10 +874,10 @@
 %     Changes the \Arg{hook} status so that from now on any addition to
 %     the hook code is executed immediately. Then execute any
 %     \Arg{hook} code already set up.
-%    \fmi{better L3 name?}
 %
 %    The \meta{hook} \emph{cannot} be specified using the dot-syntax.
 %    A leading |.| is treated literally.
+%    \fmi{better L3 name?}
 % \end{function}
 %
 % \begin{function}{\hook_gput_code:nnn}
@@ -4048,6 +4051,15 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
+\msg_new:nnn { hooks } { set-top-level }
+  {
+    You~cannot~change~the~default~label~#1~`top-level'.~Illegal \\
+    \use:nn { ~ } { ~ } \iow_char:N \\SetDefaultHookLabel{#2} \\
+    \msg_line_context:.
+  }
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \msg_new:nnn { hooks } { ddhl-deprecated }
   {
     \iow_char:N \\DeclareDefaultHookLabel~is~deprecated.\\
@@ -4199,12 +4211,6 @@
       { \msg_error:nnnn { hooks } { set-top-level } { to } {#1} }
       { \tl_gset:Nx \g_@@_hook_curr_name_tl {#1} }
   }
-\msg_new:nnn { hooks } { set-top-level }
-  {
-    You~cannot~change~the~default~label~#1~`top-level'.~Illegal \\
-    \use:nn { ~ } { ~ } \iow_char:N \\SetDefaultHookLabel{#2} \\
-    \msg_line_context:.
-  }
 \NewDocumentCommand \DeclareDefaultHookLabel { m }
   {
     \msg_error:nn { hooks } { ddhl-deprecated }





More information about the latex3-commits mailing list.