From ba211ca81b2f4659eb78240677fee2280b92599c Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Wed, 8 Jan 2025 16:21:58 +0000 Subject: [PATCH] Store spaces/tabs as actives in v-type arg --- base/changes.txt | 5 +++++ base/ltcmd.dtx | 21 +++++++++++++++++-- base/testfiles-ltcmd/github-0876.tlg | 4 ++-- base/testfiles-ltcmd/ltcmd003.tlg | 8 +++++++ .../lthooks-rollback-args.tlg | 2 ++ base/testfiles/github-0479-often.tlg | 2 ++ .../tlb-latexrelease-rollback-003-often.tlg | 4 ++++ .../tlb-latexrelease-rollback-2020-10-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2021-06-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2021-11-15.tlg | 2 ++ .../tlb-latexrelease-rollback-2022-06-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2022-11-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2023-06-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2023-11-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2024-06-01.tlg | 2 ++ .../tlb-latexrelease-rollback-2024-11-01.tlg | 2 ++ base/testfiles/tlb-rollback-004-often.tlg | 2 ++ base/testfiles/tlb-rollback-005.tlg | 2 ++ 18 files changed, 64 insertions(+), 4 deletions(-) diff --git a/base/changes.txt b/base/changes.txt index 27153d8f6..51fe304ce 100644 --- a/base/changes.txt +++ b/base/changes.txt @@ -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 + + * ltcmd.dtx: + Correct catcode of space/tab in v-type arg + 2025-01-03 Frank Mittelbach * lthooks.dtx (subsubsection{Updating code for hooks}): diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx index 50d580dfc..017767753 100644 --- a/base/ltcmd.dtx +++ b/base/ltcmd.dtx @@ -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> @@ -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} +%\IncludeInRelease{2025/06/01}{\@@_grab_v_aux_catcodes:}% +% {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 } } } +%\EndIncludeInRelease +%\IncludeInRelease{2020/10/01}{\@@_grab_v_aux_catcodes:}% +% {Active~spaces~and~tabs} +%\cs_new_protected:Npn \@@_grab_v_aux_catcodes: +% { +% \cs_set_eq:NN \do \char_set_catcode_other:N +% \dospecials +% \bool_if:NTF \l_@@_long_bool +% { \char_set_catcode_other:n { \tex_endlinechar:D } } +% { \char_set_catcode_parameter:n { \tex_endlinechar:D } } +% } +%\EndIncludeInRelease \cs_new_protected:Npn \@@_grab_v_aux_abort:n #1 { \@@_grab_v_group_end: diff --git a/base/testfiles-ltcmd/github-0876.tlg b/base/testfiles-ltcmd/github-0876.tlg index cc64782a8..f49726e63 100644 --- a/base/testfiles-ltcmd/github-0876.tlg +++ b/base/testfiles-ltcmd/github-0876.tlg @@ -4,7 +4,7 @@ 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). @@ -12,7 +12,7 @@ The token list contains the tokens: 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) diff --git a/base/testfiles-ltcmd/ltcmd003.tlg b/base/testfiles-ltcmd/ltcmd003.tlg index 4d8873e73..c7a92e99a 100644 --- a/base/testfiles-ltcmd/ltcmd003.tlg +++ b/base/testfiles-ltcmd/ltcmd003.tlg @@ -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. + \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*-%^^-{} diff --git a/base/testfiles-lthooks/lthooks-rollback-args.tlg b/base/testfiles-lthooks/lthooks-rollback-args.tlg index 6742093a4..ad28b6c42 100644 --- a/base/testfiles-lthooks/lthooks-rollback-args.tlg +++ b/base/testfiles-lthooks/lthooks-rollback-args.tlg @@ -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 .... diff --git a/base/testfiles/github-0479-often.tlg b/base/testfiles/github-0479-often.tlg index 87eedd53e..e3d413625 100644 --- a/base/testfiles/github-0479-often.tlg +++ b/base/testfiles/github-0479-often.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg index 4a30a6334..697fc2283 100644 --- a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg @@ -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 .... @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg index 78bcd955c..f429577a1 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2020-10-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg index de747289d..f7468a171 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2021-06-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg index ed889ae04..befe48394 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2021-11-15.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg index 3565f513e..928b2ac1f 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2022-06-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2022-11-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2022-11-01.tlg index bb4f7722f..1f9353eee 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2022-11-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2022-11-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2023-06-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2023-06-01.tlg index e64d2f1bc..ee09bedc8 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2023-06-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2023-06-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2023-11-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2023-11-01.tlg index 331398793..ff9c99bd4 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2023-11-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2023-11-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2024-06-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2024-06-01.tlg index 1edf42419..c879fd291 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2024-06-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2024-06-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg b/base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg index cce566b38..f89ef5d43 100644 --- a/base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg +++ b/base/testfiles/tlb-latexrelease-rollback-2024-11-01.tlg @@ -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 .... diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg index 9fbf5f74d..7ad8f8ca4 100644 --- a/base/testfiles/tlb-rollback-004-often.tlg +++ b/base/testfiles/tlb-rollback-004-often.tlg @@ -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 .... diff --git a/base/testfiles/tlb-rollback-005.tlg b/base/testfiles/tlb-rollback-005.tlg index bba3f4f7e..a1e564f37 100644 --- a/base/testfiles/tlb-rollback-005.tlg +++ b/base/testfiles/tlb-rollback-005.tlg @@ -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 ....