Skip to content

Commit

Permalink
Store spaces/tabs as actives in v-type arg
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Jan 8, 2025
1 parent b34260d commit ba211ca
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 4 deletions.
5 changes: 5 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2025-01-08 Joseph Wright <Joseph.Wright@latex-project.org>

* ltcmd.dtx:
Correct catcode of space/tab in v-type arg

2025-01-03 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* lthooks.dtx (subsubsection{Updating code for hooks}):
Expand Down
21 changes: 19 additions & 2 deletions base/ltcmd.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
%%% From File: ltcmd.dtx
%
% \begin{macrocode}
\def\ltcmdversion{v1.2f}
\def\ltcmddate{2024-12-25}
\def\ltcmdversion{v1.2g}
\def\ltcmddate{2025-01-08}
% \end{macrocode}
%
%<*driver>
Expand Down Expand Up @@ -3663,20 +3663,37 @@
% \end{macro}
%
% \begin{macro}{\@@_grab_v_aux_catcodes:}
% \changes{v1.2g}{2025-01-08}{Store spaces and tabs as active chars}
% \begin{macro}{\@@_grab_v_aux_abort:n}
% The approach for short verbatim arguments is to make the end-line
% character a macro parameter character: this is forbidden by the
% rest of the code. Then the error branch can check what caused the
% bail out and give the appropriate error message.
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2025/06/01}{\@@_grab_v_aux_catcodes:}%
%<latexrelease> {Active~spaces~and~tabs}
\cs_new_protected:Npn \@@_grab_v_aux_catcodes:
{
\cs_set_eq:NN \do \char_set_catcode_other:N
\dospecials
\char_set_catcode_active:n { `\ }
\char_set_catcode_active:n { `\^^I }
\bool_if:NTF \l_@@_long_bool
{ \char_set_catcode_other:n { \tex_endlinechar:D } }
{ \char_set_catcode_parameter:n { \tex_endlinechar:D } }
}
%<latexrelease>\EndIncludeInRelease
%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_grab_v_aux_catcodes:}%
%<latexrelease> {Active~spaces~and~tabs}
%<latexrelease>\cs_new_protected:Npn \@@_grab_v_aux_catcodes:
%<latexrelease> {
%<latexrelease> \cs_set_eq:NN \do \char_set_catcode_other:N
%<latexrelease> \dospecials
%<latexrelease> \bool_if:NTF \l_@@_long_bool
%<latexrelease> { \char_set_catcode_other:n { \tex_endlinechar:D } }
%<latexrelease> { \char_set_catcode_parameter:n { \tex_endlinechar:D } }
%<latexrelease> }
%<latexrelease>\EndIncludeInRelease
\cs_new_protected:Npn \@@_grab_v_aux_abort:n #1
{
\@@_grab_v_group_end:
Expand Down
4 changes: 2 additions & 2 deletions base/testfiles-ltcmd/github-0876.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ The token list contains the tokens:
> b (the character b)
> a (the character a)
> r (the character r)
> (blank space )
> (active character=macro:-> )
> b (the character b)
> a (the character a)
> r (the character r).
<recently read> }
l. ...bar+
^^M
The token list contains the tokens:
> (blank space )
> (active character=macro:-> )
> b (the character b)
> a (the character a)
> r (the character r)
Expand Down
8 changes: 8 additions & 0 deletions base/testfiles-ltcmd/ltcmd003.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Don't change this file in any respect.
Author: Bruno Le Floch
I got '\foo-\foo-{}
I got '\foo-% ^^-{k}
! Undefined control sequence.
<argument> \ERROR
l. ...\foo+% ^^+^^+
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.
I got '\foo*-#^^-{&&&}
I got '\foo*-%#^^-{}
I got '\foo*-%^^-{}
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles-lthooks/lthooks-rollback-args.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/github-0479-often.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
4 changes: 4 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-003-often.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down Expand Up @@ -944,6 +946,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2022-11-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2023-06-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2023-11-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2024-06-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Already applied: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Already applied: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Already applied: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-rollback-004-often.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down
2 changes: 2 additions & 0 deletions base/testfiles/tlb-rollback-005.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Applying: [....-..-..] Support \ShowCommand in ltcmd on input line ....
Skipping: [....-..-..] Active spaces and tabs on input line ....
Applying: [....-..-..] Active spaces and tabs on input line ....
Skipping: [....-..-..] Endlines as \obeyedline on input line ....
Applying: [....-..-..] Endlines as \obeyedline on input line ....
Skipping: [....-..-..] Trim spaces from envname first on input line ....
Expand Down

0 comments on commit ba211ca

Please sign in to comment.