[latex3-commits] [git/LaTeX3-latex3-latex2e] kernel-msgs: Merge branch 'cmdhook-fixes' into kernel-msgs (5cbe4b22)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed May 26 11:16:10 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : kernel-msgs
Link       : https://github.com/latex3/latex2e/commit/5cbe4b2235c393f18ac3802dc73ffaf0039bc495

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

commit 5cbe4b2235c393f18ac3802dc73ffaf0039bc495
Merge: 1383fcba afd9cfc7
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed May 26 11:16:10 2021 +0200

    Merge branch 'cmdhook-fixes' into kernel-msgs
    
    # Conflicts:
    #       base/changes.txt
    #       base/ltcmdhooks.dtx
    #       base/lthooks.dtx
    #       base/testfiles-lthooks/lthooks-errors.tlg


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

5cbe4b2235c393f18ac3802dc73ffaf0039bc495
 base/changes.txt                          |  5 ++++
 base/ltcmdhooks.dtx                       |  4 +--
 base/lthooks.dtx                          | 18 +-----------
 base/testfiles-lthooks/ltcmdhooks-011.lvt | 29 +++++++++++++++++++
 base/testfiles-lthooks/ltcmdhooks-011.tlg | 39 +++++++++++++++++++++++++
 base/testfiles-lthooks/lthooks-errors.lvt | 37 ++++++++++++++++++++----
 base/testfiles-lthooks/lthooks-errors.tlg | 48 +++++++++++++++++++++++++++++++
 base/update-lthooks-tests.sh              |  1 +
 8 files changed, 157 insertions(+), 24 deletions(-)

diff --cc base/changes.txt
index 4d45340d,b72d69d4..b389ade0
--- a/base/changes.txt
+++ b/base/changes.txt
@@@ -6,17 -6,11 +6,22 @@@ completeness or accuracy and it contain
  are not part of the distribution.
  ================================================================================
  
+ 2021-05-26  Phelype Oleinik  <phelype.oleinik at latex-project.org>
+ 
+ 	* lthooks.dtx:
+ 	Remove deprecated \DeclareDefaultHookLabel for good.
+ 
 +2021-05-25  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 +
 +	* lthooks.dtx, ltfilehook.dtx:
 +	Normalized some error message texts
 +
 +2021-05-24  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 +
 +	* ltcmd.dtx, ltcmdhooks.dtx, ltfilehook.dtx, lthooks.dtx, ltpara.dtx:
 +	Use \msg_... instead of \__kernel_msg... commands for normalized
 +	error and warning commands.
 +
  2021-05-14  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
  
  	* ltoutput.dtx: normalize the error commands, always use
diff --cc base/ltcmdhooks.dtx
index 3971cd90,f07c8481..a4220105
--- a/base/ltcmdhooks.dtx
+++ b/base/ltcmdhooks.dtx
@@@ -416,7 -413,7 +416,7 @@@
      \str_case:nnTF {#3}
          { { before } { } { after } { } }
        { \exp_args:Nc \@@_patch_cmd_or_delay:Nnn {#2} {#2} {#3} }
-       { \msg_error:nnn { hooks } { wrong-cmd-hook } {#2} {#3} }
 -      { \__kernel_msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} }
++      { \msg_error:nnnn { hooks } { wrong-cmd-hook } {#2} {#3} }
    }
  %    \end{macrocode}
  % \end{macro}
diff --cc base/lthooks.dtx
index 53e80bde,38e636ce..6156b2b1
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@@ -4638,16 -4627,7 +4638,7 @@@
  %    \end{macrocode}
  %
  %    \begin{macrocode}
- \msg_new:nnn { hooks } { ddhl-deprecated }
-   {
-     \iow_char:N \\DeclareDefaultHookLabel~is~deprecated.\\
-     Use~\iow_char:N \\SetDefaultHookLabel~instead.\\ \\
-     The~deprecated~name~will~be~removed~in~the~next~release.
-   }
- %    \end{macrocode}
- %
- %    \begin{macrocode}
 -\__kernel_msg_new:nnn { hooks } { extra-pop-label }
 +\msg_new:nnn { hooks } { extra-pop-label }
    {
      Extra~\iow_char:N \\PopDefaultHookLabel. \\
      This~command~will~be~ignored.
diff --cc base/testfiles-lthooks/ltcmdhooks-011.tlg
index 00000000,059368d5..4c65f6c0
mode 000000,100644..100644
--- a/base/testfiles-lthooks/ltcmdhooks-011.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-011.tlg
@@@ -1,0 -1,39 +1,39 @@@
+ This is a generated file for the l3build validation system.
+ Don't change this file in any respect.
 -! LaTeX3 Error: Command hook `cmd/textbf/middle' invalid.
 -(LaTeX3)        The hook should be `cmd/textbf/before' or
 -(LaTeX3)        `cmd/textbf/after'.
++! LaTeX hooks Error: Command hook `cmd/textbf/middle' invalid.
++(hooks)              The hook should be `cmd/textbf/before' or
++(hooks)              `cmd/textbf/after'.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{cmd/textbf/middle}{error}
+ You tried to add a hook to command \textbf, but `middle' is an invalid
 -position. Only `before' or `after' are allowed.
 -! LaTeX3 Error: Command `\undefined' cannot have hooks because it doesn't
 -(LaTeX3)        exist.
++component. Only `before' or `after' are allowed.
++! LaTeX hooks Error: Command `\undefined' cannot have hooks because it doesn't
++(hooks)              exist.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{cmd/undefined/before}{error}
+ You tried to add a hook to `\undefined', but LaTeX was not able to add the
+ hook to that command because `\undefined' doesn't exist.
 -! LaTeX3 Error: Command `\detokenize' cannot have hooks because it is not a
 -(LaTeX3)        macro.
++! LaTeX hooks Error: Command `\detokenize' cannot have hooks because it is not
++(hooks)              a macro.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{cmd/detokenize/before}{error}
+ You tried to add a hook to `\detokenize', but LaTeX was not able to add the
+ hook to that command because `\detokenize' is not a macro.
 -! LaTeX3 Error: Command `\__hook_cmd_begindocument_code:' cannot have hooks
 -(LaTeX3)        because it doesn't exist.
++! LaTeX hooks Error: Command `\__hook_cmd_begindocument_code:' cannot have
++(hooks)              hooks because it doesn't exist.
+ For immediate help type H <return>.
+  ...                                              
+ l. ......ook_cmd_begindocument_code:/before}{error}
+ You tried to add a hook to `\__hook_cmd_begindocument_code:', but LaTeX was
+ not able to add the hook to that command because
+ `\__hook_cmd_begindocument_code:' doesn't exist.
 -! LaTeX3 Error: Command `\mycmd' cannot have hooks because it can't be
 -(LaTeX3)        retokenized cleanly.
++! LaTeX hooks Error: Command `\mycmd' cannot have hooks because it can't be
++(hooks)              retokenized cleanly.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{cmd/mycmd/before}{error}
+ You tried to add a hook to `\mycmd', but LaTeX was not able to add the hook to
+ that command because `\mycmd' can't be retokenized cleanly.
diff --cc base/testfiles-lthooks/lthooks-errors.tlg
index c092960b,5abd7ead..c16ca48c
--- a/base/testfiles-lthooks/lthooks-errors.tlg
+++ b/base/testfiles-lthooks/lthooks-errors.tlg
@@@ -1,7 -1,55 +1,55 @@@
  This is a generated file for the l3build validation system.
  Don't change this file in any respect.
 -! LaTeX3 Error: Hook 'xxx' has already been declared.
++! LaTeX hooks Error: Hook 'xxx' has already been declared.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\NewHook{xxx}
+ There already exists a hook declaration with this name.
+ Please use a different name for your hook.
 -! LaTeX3 Error: Hook 'xxx' already declared as a normal hook!
++! LaTeX hooks Error: Hook 'xxx' already declared as a normal hook!
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\ProvideReversedHook{xxx}
+ You attempted to provide the hook 'xxx' as a reversed hook, but it was already
+ previously declared as a normal hook. A redeclaration is not possible.
 -! LaTeX3 Error: Hook 'yyy' already declared as a reversed hook!
++! LaTeX hooks Error: Hook 'yyy' already declared as a reversed hook!
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\ProvideHook{yyy}
+ You attempted to provide the hook 'yyy' as a normal hook, but it was already
+ previously declared as a reversed hook. A redeclaration is not possible.
 -LaTeX3 Warning: Can't provide hook 'yyy' because it is disabled!
 -! LaTeX3 Error: Cannot add code to disabled hook 'yyy'.
++LaTeX hooks Warning: Cannot provide hook 'yyy' because it is disabled!
++! LaTeX hooks Error: Cannot add code to disabled hook 'yyy'.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{yyy}{error}
+ The hook 'yyy' you tried to add code to was previously disabled with
+ \hook_disable:n or \DisableHook, so it cannot have code added to it.
+ ! Undefined control sequence.
 -<argument> \LaTeX3 error: 
 -                           Empty code label on line .... Using 'top-level' in...
++<argument> \::error 
++                    ! hooks: Empty code label on line .... Using 'top-level' ...
+ l. ...\AddToHook{yyy}[]{error}
+ The control sequence at the end of the top line
+ of your error message was never \def'ed. If you have
+ misspelled it (e.g., `\hobx'), type `I' and the correct
+ spelling (e.g., `I\hbox'). Otherwise just continue,
+ and I'll forget about whatever was undefined.
 -! LaTeX3 Error: Cannot add code to disabled hook 'yyy'.
++! LaTeX hooks Error: Cannot add code to disabled hook 'yyy'.
+ For immediate help type H <return>.
+  ...                                              
+ l. ...\AddToHook{yyy}[]{error}
+ The hook 'yyy' you tried to add code to was previously disabled with
+ \hook_disable:n or \DisableHook, so it cannot have code added to it.
 -! LaTeX3 Error: Missing (empty) default label on line ....
 -(LaTeX3)        This command was ignored.
++! LaTeX hooks Error: Missing (empty) default label on line ....
++(hooks)              This command was ignored.
+ Type <return> to continue.
+  ...                                              
+ l. ...\PushDefaultHookLabel{}
+ LaTeX does not know anything more about this error, sorry.
+ Try typing <return> to proceed.
+ If that doesn't work, type X <return> to quit.
 -! LaTeX3 Error: Unknown relationship 'unknown' between labels 'label1' and
 -(LaTeX3)        'label2'  in hook 'xxx'. Perhaps a missspelling?
 +! LaTeX hooks Error: Unknown relationship 'unknown' between labels 'label1'
 +(hooks)              and 'label2'  in hook 'xxx'. Perhaps a missspelling?
  For immediate help type H <return>.
   ...                                              
  l. ......HookRule {xxx} {label1} {unknown} {label2}
diff --cc base/update-lthooks-tests.sh
index 8bb592e8,8bb592e8..31127810
--- a/base/update-lthooks-tests.sh
+++ b/base/update-lthooks-tests.sh
@@@ -40,6 -40,6 +40,7 @@@ l3build save -cconfig-lthooks 
   ltcmdhooks-008 \
   ltcmdhooks-009 \
   ltcmdhooks-010 \
++ ltcmdhooks-011 \
     filehook-001 \
     filehook-002 \
     filehook-003 \





More information about the latex3-commits mailing list.