-
-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
\AddToHook unexpected side effect #1591
Comments
The Lines 584 to 589 in 7d4ec54
Luckyly, as \RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!
\documentclass{article}
\ExplSyntaxOn
\cs_undefine:N \__hook_try_put_cmd_hook:w
\cs_new_protected:Npn \__hook_try_put_cmd_hook:w
#1 / #2 / #3 / #4 \s__hook_mark #5
{
\__hook_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } }
\group_begin: % <<< added
\exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3}
\group_end: % <<< added
}
\ExplSyntaxOff
\AddToHook{cmd/FOO/before}{}
\begin{document}
\show\FOO
\end{document} |
@muzimuzhi I was thinking along the same lines, but I don't like to introduce a dependency of relying on |
ef35caf#diff-a37b1fd2a3d174eb379905a10f50d81a694fa77b3f8252390a53076ff6bb7933 base/doc/ltnews41.tex line 378:
Replace |
already done a few hours ago 76ecf9d |
* fix for #1591 * fix typo * Apply suggestions from code review Co-authored-by: Yukai Chou <[email protected]> --------- Co-authored-by: Yukai Chou <[email protected]>
Brief outline of the bug
Assume
\FOO
is not defined.After
\AddToHook{cmd/FOO/before}{}
\FOO
is\relax
and no longer breaks when used.This should not be considered a feature.
Minimal example showing the bug
Log file (required) and possibly PDF file
The text was updated successfully, but these errors were encountered: