Skip to content

Commit

Permalink
Revert "fix for #1459"
Browse files Browse the repository at this point in the history
This reverts commit 055eb78.
  • Loading branch information
FrankMittelbach committed Nov 26, 2024
1 parent ca8965d commit bdcf809
Show file tree
Hide file tree
Showing 33 changed files with 2,400 additions and 2,697 deletions.
7 changes: 0 additions & 7 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2024-11-26 Frank Mittelbach <[email protected]>

* lthooks.dtx (subsection{Specifying code for next invocation}):
Add debugging message into \AddToHookNext and friends (gh/1459)

Slightly adjust messages in other places.

2024-11-17 Frank Mittelbach <[email protected]>

* ltmarks.dtx (section{Public interfaces for packages such as \pkg{multicol}}):
Expand Down
49 changes: 7 additions & 42 deletions base/lthooks.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
%<*driver>
% \fi
\ProvidesFile{lthooks.dtx}
[2024/11/26 v1.1l LaTeX Kernel (hooks)]
[2024/10/29 v1.1k LaTeX Kernel (hooks)]
% \iffalse
%
\documentclass{l3doc}
Expand Down Expand Up @@ -3707,13 +3707,11 @@
{
% \end{macrocode}
% However, first some debugging info if debugging is enabled:
% \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)}
% \begin{macrocode}
\@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~
\@@_debug:n{\iow_term:x{****~ Add~ to~
\@@_if_usable:nF {#1} { undeclared~ }
hook~ '#1'~ (#2) \on@line
^^J [lthooks] \@spaces
<-~ \tl_to_str:n{#3}} }
hook~ #1~ (#2)
\on@line\space <-~ \tl_to_str:n{#3}} }
% \end{macrocode}
% Then try to get the code chunk labeled \verb=#2= from the hook.
% If there's code already there, then append \verb=#3= to that,
Expand Down Expand Up @@ -5376,11 +5374,10 @@
% \end{macrocode}
% If we are debugging we show results hook by hook for all hooks
% that have data.
% \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)}
% \begin{macrocode}
\@@_debug:n
{
\iow_term:x { ^^J[lthooks]~ All~initialized~(non-empty)~hooks: }
\iow_term:x { ^^J All~initialized~(non-empty)~hooks: }
\prop_map_inline:Nn \g_@@_used_prop
{
\iow_term:x
Expand Down Expand Up @@ -5436,14 +5433,13 @@
% afterwards only if the hook code changes.
% \changes{v1.1a}{2023/04/06}
% {Changes to add hook arguments (hook-args).}
% \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)}
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2023/06/01}{\@@_initialize_hook_code:n}
%<latexrelease> {Hooks~with~args}
\cs_new_protected:Npn \@@_initialize_hook_code:n #1
{
\@@_debug:n
{ \iow_term:x { ^^J[lthooks]~ Update~code~for~hook~'#1' \on@line :^^J } }
{ \iow_term:x { ^^J Update~code~for~hook~'#1' \on@line :^^J } }
% \end{macrocode}
% This does the sorting and the updates.
% First thing we do is to check if a legacy hook macro exists and
Expand Down Expand Up @@ -5736,10 +5732,9 @@
\exp_args:NNV \@@_tl_gput:Nn #1 \l_@@_return_tl
% \end{macrocode}
%
% \changes{v1.1l}{2024/11/26}{Adjust debugging message (gh/1459)}
% \begin{macrocode}
\@@_clist_gput:NV #2 \l_@@_front_tl
\@@_debug:n{ \iow_term:x{[lthooks]~ Handled~ code~ for~ \l_@@_front_tl} }
\@@_debug:n{ \iow_term:x{Handled~ code~ for~ \l_@@_front_tl} }
% \end{macrocode}
%
% This is step T6, except that we don't use a pointer $P$ to move
Expand Down Expand Up @@ -6540,42 +6535,12 @@
{
\@@_replacing_args_false:
\@@_normalize_hook_args:Nn \@@_gput_next_code:nn {#1} {#2}
% \end{macrocode}
%
% \changes{v1.1l}{2024/11/26}{Add debugging message (gh/1459)}
% \begin{macrocode}
\@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~
\@@_if_usable:nF {#1} { undeclared~ }
hook~ '#1'~ ( next~ invocation~ only )
\on@line
^^J [lthooks] \@spaces
<-~ \tl_to_str:n{#2}
}
}
% \end{macrocode}
%
% \begin{macrocode}
\@@_replacing_args_reset:
}
\cs_new_protected:Npn \hook_gput_next_code_with_args:nn #1 #2
{
\@@_replacing_args_true:
\@@_normalize_hook_args:Nn \@@_gput_next_code:nn {#1} {#2}
% \end{macrocode}
%
% \changes{v1.1l}{2024/11/26}{Add debugging message (gh/1459)}
% \begin{macrocode}
\@@_debug:n{\iow_term:x{[lthooks]~ Add~ to~
\@@_if_usable:nF {#1} { undeclared~ }
hook~ '#1'~ ( next~ invocation~ only )
\on@line
^^J [lthooks] \@spaces
<-~ \tl_to_str:n{#2}
}
}
% \end{macrocode}
%
% \begin{macrocode}
\@@_replacing_args_reset:
}
%<latexrelease>\EndIncludeInRelease
Expand Down
55 changes: 25 additions & 30 deletions base/testfiles-lthooks/filehook-002.tlg
Original file line number Diff line number Diff line change
@@ -1,78 +1,73 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
[lthooks] Update code for hook 'package/before' on input line ...:
[lthooks] Update code for hook 'file/before' on input line ...:
Update code for hook 'package/before' on input line ...:
Update code for hook 'file/before' on input line ...:
(structuredlog.sty
Package: structuredlog ....-..-.. vv... Structuring the TeX transcript file
\g__filehook_nesting_level_int=\count...
[lthooks] Add to hook 'file/before' (structuredlog) on input line ...
[lthooks] <- \__filehook_log_file_record:n {START}
[lthooks] Add to hook 'file/after' (next invocation only) on input line ...
[lthooks] <- \AddToHook {file/after}{\__filehook_log_file_record:n {STOP}}
**** Add to hook file/before (structuredlog) on input line ... <- \__filehook_log_file_record:n {START}
)
[lthooks] Update code for hook 'file/after' on input line ...:
[lthooks] Add to hook 'file/after' (structuredlog) on input line ...
[lthooks] <- \__filehook_log_file_record:n {STOP}
[lthooks] Update code for hook 'package/after' on input line ...:
[lthooks] Update code for hook 'package/before' on input line ...:
[lthooks] Update code for hook 'file/before' on input line ...:
Update code for hook 'file/after' on input line ...:
**** Add to hook file/after (structuredlog) on input line ... <- \__filehook_log_file_record:n {STOP}
Update code for hook 'package/after' on input line ...:
Update code for hook 'package/before' on input line ...:
Update code for hook 'file/before' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
= (LEVEL 1 START) tracefnt.sty
(tracefnt.sty
Package: tracefnt ....-..-.. v... Standard LaTeX package (font tracing)
\tracingfonts=\count...
LaTeX Info: Redefining \selectfont on input line ....
[lthooks] Add to hook 'selectfont' (tracefnt) on input line ...
[lthooks] <- \ifnum \tracingfonts >\tw@ \@font@info {Switching to \font@name }\fi
**** Add to hook selectfont (tracefnt) on input line ... <- \ifnum \tracingfonts >\tw@ \@font@info {Switching to \font@name }\fi
Applying: [....-..-..] Add hook to \selectfont on input line ....
Already applied: [....-..-..] Add hook to \selectfont on input line ....
)
[lthooks] Update code for hook 'file/after' on input line ...:
Update code for hook 'file/after' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
= (LEVEL 1 STOP) tracefnt.sty
[lthooks] Update code for hook 'package/after' on input line ...:
[lthooks] Update code for hook 'class/before' on input line ...:
[lthooks] Update code for hook 'file/before' on input line ...:
Update code for hook 'package/after' on input line ...:
Update code for hook 'class/before' on input line ...:
Update code for hook 'file/before' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
= (LEVEL 1 START) article.cls
(article.cls
Document Class: article ....-..-.. v... Standard LaTeX document class
[lthooks] Update code for hook 'file/before' on input line ...:
Update code for hook 'file/before' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
== (LEVEL 2 START) size10.clo
(size10.clo
File: size10.clo ....-..-.. v... Standard LaTeX file (size option)
LaTeX Font Info: External font `cmr10 at10.0pt' loaded as
(Font) OT1/cmr/m/n/10 on input line ....
[lthooks] Update code for hook 'selectfont' on input line ...:
Update code for hook 'selectfont' on input line ...:
Code labels for sorting:
tracefnt
Data structure for label rules:
tracefnt = 0 ->
[lthooks] Handled code for tracefnt
Handled code for tracefnt
)
[lthooks] Update code for hook 'file/after' on input line ...:
Update code for hook 'file/after' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
== (LEVEL 2 STOP) size10.clo
\c@part=\count...
\c@section=\count...
Expand All @@ -86,11 +81,11 @@ Data structure for label rules:
\belowcaptionskip=\skip...
\bibindent=\dimen...
)
[lthooks] Update code for hook 'file/after' on input line ...:
Update code for hook 'file/after' on input line ...:
Code labels for sorting:
structuredlog
Data structure for label rules:
structuredlog = 0 ->
[lthooks] Handled code for structuredlog
Handled code for structuredlog
= (LEVEL 1 STOP) article.cls
[lthooks] Update code for hook 'class/after' on input line ...:
Update code for hook 'class/after' on input line ...:
39 changes: 0 additions & 39 deletions base/testfiles-lthooks/github-1459.lvt

This file was deleted.

30 changes: 0 additions & 30 deletions base/testfiles-lthooks/github-1459.tlg

This file was deleted.

Loading

0 comments on commit bdcf809

Please sign in to comment.