[latex3-commits] [git/LaTeX3-latex3-latex2e] ltcmdhooks: In the kernel we don't need that test (fe433da0)

PhelypeOleinik phelype.oleinik at latex-project.org
Sat Apr 17 20:59:38 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : ltcmdhooks
Link       : https://github.com/latex3/latex2e/commit/fe433da044afcb14909a9ab0467f74d263d3128e

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

commit fe433da044afcb14909a9ab0467f74d263d3128e
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Sat Apr 17 15:59:38 2021 -0300

    In the kernel we don't need that test
    
    And it was wrong anyway :)


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

fe433da044afcb14909a9ab0467f74d263d3128e
 base/ltcmdhooks.dtx                       |   9 +-
 base/testfiles-lthooks/ltcmdhooks-004.tlg | 356 +-----------------------------
 2 files changed, 8 insertions(+), 357 deletions(-)

diff --git a/base/ltcmdhooks.dtx b/base/ltcmdhooks.dtx
index da5fb637..a02c479b 100644
--- a/base/ltcmdhooks.dtx
+++ b/base/ltcmdhooks.dtx
@@ -1417,13 +1417,8 @@
 % \pho{To be properly integrated}
 %
 %    \begin{macrocode}
-\ifdefined \__cmd_cmd_if_xparse:N
-  \prg_new_eq_conditional:NNn \@@_cmd_if_xparse:N
-    \__cmd_cmd_if_xparse:N { TF }
-\else
-  \prg_new_eq_conditional:NNn \@@_cmd_if_xparse:N
-    \__xparse_cmd_if_xparse:N { TF }
-\fi
+\prg_new_eq_conditional:NNn \@@_cmd_if_xparse:N
+  \__cmd_cmd_if_xparse:N { TF }
 \tl_gput_right:Nn \g_hook_patch_action_list_tl
   { { \@@_cmd_if_xparse:NTF \@@_cmd_patch_xparse:Nn } }
 \cs_new_protected:Npn \@@_cmd_patch_xparse:Nn #1 #2
diff --git a/base/testfiles-lthooks/ltcmdhooks-004.tlg b/base/testfiles-lthooks/ltcmdhooks-004.tlg
index 9b05d30c..fb32fdbd 100644
--- a/base/testfiles-lthooks/ltcmdhooks-004.tlg
+++ b/base/testfiles-lthooks/ltcmdhooks-004.tlg
@@ -67,160 +67,15 @@ ltcmd Command (always expand-and-redefine)
 [lthooks] ++ control sequence is defined
 [lthooks] ++ control sequence is a macro
 [lthooks] ++ macro is not private
-! Argument of \baz  has an extra }.
-<inserted text> 
-                \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \baz  was complete.
-<to be read again> 
-                   \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at do has an extra }.
-<inserted text> 
-                \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-{\__hook_cmd_patch_xparse:Nn }
-! Paragraph ended before \robust at command@act at do was complete.
-<to be read again> 
-                   \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at loop has an extra }.
-<inserted text> 
-                \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \robust at command@act at loop was complete.
-<to be read again> 
-                   \par 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-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.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......p-level] \string\baz\space with {#1}[#2]}}
-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.
-[lthooks] .. command can only be patched by rescanning
 [lthooks] ++ command can be patched without rescanning
 **** Add to hook cmd/baz/before (top-level) on input line ... <- \typeout {[top-level] \string \baz \space with {##1}[##2]}
 Update code for hook 'cmd/baz/before' on input line ...:
 -> Adding cmd hook to 'baz' (after):
 [lthooks] analyzing '\baz'
-[lthooks] \baz=\protected macro:->\UseHook {cmd/baz/before}\__cmd_start:nNNnnn {mo}\baz  \baz code {\__cmd_grab_m_1:w \__cmd_grab_D:w []}{}{}
+[lthooks] \baz=\protected macro:->\__cmd_start:nNNnnn {mo}\baz  \baz code {\__cmd_grab_m_1:w \__cmd_grab_D:w []}{}{}
 [lthooks] ++ control sequence is defined
 [lthooks] ++ control sequence is a macro
 [lthooks] ++ macro is not private
-[top-level] \baz with {##1}[##2]
-! Argument of \baz  has an extra }.
-<inserted text> 
-                \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \baz  was complete.
-<to be read again> 
-                   \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at do has an extra }.
-<inserted text> 
-                \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-{\__hook_cmd_patch_xparse:Nn }
-! Paragraph ended before \robust at command@act at do was complete.
-<to be read again> 
-                   \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at loop has an extra }.
-<inserted text> 
-                \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \robust at command@act at loop was complete.
-<to be read again> 
-                   \par 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-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.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......t{[main] \string\baz\space with {#1}[#2]}}
-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.
-[lthooks] .. command can only be patched by rescanning
 [lthooks] ++ command can be patched without rescanning
 **** Add to hook cmd/baz/after (lbl) on input line ... <- \typeout {[main] \string \baz \space with {##1}[##2]}
 Update code for hook 'cmd/baz/after' on input line ...:
@@ -230,28 +85,8 @@ Data structure for label rules:
  lbl = 0 -> 
 Handled code for lbl
 [top-level] \baz with {##1}[##2]
-! Argument of \hook_use:n has an extra }.
-<inserted text> 
-                \par 
-l. ...\baz
-         {hello}[world]
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \hook_use:n was complete.
-<to be read again> 
-                   \par 
-l. ...\baz
-         {hello}[world]
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-\baz{
-}[-NoValue-]
+\baz{hello}[world]
+[main] \baz with {##1}[##2]
 ltcmd expandable Command (always expand-and-redefine)
 -> Adding cmd hook to 'boo' (before):
 [lthooks] analyzing '\boo'
@@ -259,175 +94,15 @@ ltcmd expandable Command (always expand-and-redefine)
 [lthooks] ++ control sequence is defined
 [lthooks] ++ control sequence is a macro
 [lthooks] ++ macro is not private
-! Argument of \boo  has an extra }.
-<inserted text> 
-                \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \boo  was complete.
-<to be read again> 
-                   \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at do has an extra }.
-<inserted text> 
-                \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-{\__hook_cmd_patch_xparse:Nn }
-! Paragraph ended before \robust at command@act at do was complete.
-<to be read again> 
-                   \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at loop has an extra }.
-<inserted text> 
-                \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \robust at command@act at loop was complete.
-<to be read again> 
-                   \par 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-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.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......level] \string\boo\space with [#1]{#2}^^J}
-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.
-[lthooks] .. command can only be patched by rescanning
 [lthooks] ++ command can be patched without rescanning
 **** Add to hook cmd/boo/before (top-level) on input line ... <- [top-level] \string \boo \space with [##1]{##2}
 Update code for hook 'cmd/boo/before' on input line ...:
 -> Adding cmd hook to 'boo' (after):
 [lthooks] analyzing '\boo'
-[lthooks] \boo=macro:->\UseHook {cmd/boo/before}\__cmd_start_expandable:nNNNNn {om}\boo  \boo  \boo code ?{\__cmd_expandable_grab_D:w \boo (arg 1) []\__cmd_expandable_grab_m:w }
+[lthooks] \boo=macro:->\__cmd_start_expandable:nNNNNn {om}\boo  \boo  \boo code ?{\__cmd_expandable_grab_D:w \boo (arg 1) []\__cmd_expandable_grab_m:w }
 [lthooks] ++ control sequence is defined
 [lthooks] ++ control sequence is a macro
 [lthooks] ++ macro is not private
-! You can't use `macro parameter character #' in horizontal mode.
-\__hook_toplevel cmd/boo/before ...\space with [##
-                                                  1]{##2}^^J
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-Sorry, but I'm not programmed to handle this case;
-I'll just pretend that you didn't ask for it.
-If you're in the wrong mode, you might be able to
-return to the right one by typing `I}' or `I$' or `I\par'.
-! You can't use `macro parameter character #' in horizontal mode.
-\__hook_toplevel cmd/boo/before ...e with [##1]{##
-                                                  2}^^J
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-Sorry, but I'm not programmed to handle this case;
-I'll just pretend that you didn't ask for it.
-If you're in the wrong mode, you might be able to
-return to the right one by typing `I}' or `I$' or `I\par'.
-! Argument of \boo  has an extra }.
-<inserted text> 
-                \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \boo  was complete.
-<to be read again> 
-                   \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at do has an extra }.
-<inserted text> 
-                \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-{\__hook_cmd_patch_xparse:Nn }
-! Paragraph ended before \robust at command@act at do was complete.
-<to be read again> 
-                   \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Argument of \robust at command@act at loop has an extra }.
-<inserted text> 
-                \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \robust at command@act at loop was complete.
-<to be read again> 
-                   \par 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-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.
-! Undefined control sequence.
-\@nnil ->\@nil 
-l. ......[main] \string\boo\space with [#1]{#2}^^J}
-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.
-[lthooks] .. command can only be patched by rescanning
 [lthooks] ++ command can be patched without rescanning
 **** Add to hook cmd/boo/after (lbl) on input line ... <- [main] \string \boo \space with [##1]{##2}
 Update code for hook 'cmd/boo/after' on input line ...:
@@ -436,25 +111,6 @@ Code labels for sorting:
 Data structure for label rules:
  lbl = 0 -> 
 Handled code for lbl
-! Argument of \hook_use:n has an extra }.
-<inserted text> 
-                \par 
-l. ...\typeout{\boo[hello]{world}}
-I've run across a `}' that doesn't seem to match anything.
-For example, `\def\a#1{...}' and `\a}' would produce
-this error. If you simply proceed now, the `\par' that
-I've just inserted will cause me to report a runaway
-argument that might be the root of the problem. But if
-your `}' was spurious, just type `2' and it will go away.
-Runaway argument?
-! Paragraph ended before \hook_use:n was complete.
-<to be read again> 
-                   \par 
-l. ...\typeout{\boo[hello]{world}}
-I suspect you've forgotten a `}', causing me to apply this
-control sequence to too much text. How can we recover?
-My plan is to forget the whole thing and hope for the best.
 [top-level] \boo with [##1]{##2}
-\boo[-NoValue-]{
-}
-{cmd/boo/after}[hello]{world}
+\boo[hello]{world}
+[main] \boo with [##1]{##2}





More information about the latex3-commits mailing list.