Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Dec 30, 2024
2 parents cd1601e + 5dbc00a commit b6c8994
Show file tree
Hide file tree
Showing 81 changed files with 668 additions and 129 deletions.
26 changes: 25 additions & 1 deletion base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,33 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2024-12-22 Ulrike Fischer <[email protected]>

2024-12-30 Ulrike Fischer <[email protected]>
* lttagging.dtx: add sockets for luamml support.

2024-12-27 Frank Mittelbach <[email protected]>

* ltsockets.dtx:
Add conditionals for sockets, plugs, and assignments (gh/1577)

2024-12-25 Frank Mittelbach <[email protected]>

* doc.dtx (subsection{Producing the actual index entries}):
Describe that \levelchar and other reference macros can't be used in
\index entries that are used directly in the document and aren't hidden
inside other macros (because then no expansion happens) gh/1418

2024-12-23 Frank Mittelbach <[email protected]>

* docstrip.dtx (subsection{Batchfile commands}):
Check that the stream macro (with the name of a file to generate) is not
already used, e.g., as a declared preamble (gh/1150)

2024-12-22 Frank Mittelbach <[email protected]>

* ltcmdhooks.dtx (subsection{Patching or delaying}):
Avoid defining command while adding a cmd hook (gh/1591)

2024-12-21 Joseph Wright <[email protected]>
* ltoutenc.dtx
Correct \=\i setup in T1 (gh/1587)
Expand Down
20 changes: 17 additions & 3 deletions base/doc.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
%<+package>
%<+package>\ProvidesPackage{doc}
%<+shortvrb>\ProvidesPackage{shortvrb}
%<+package|shortvrb> [2024/10/23 v3.0q
%<+package|shortvrb> [2024/12/25 v3.0q
%<+package|shortvrb> Standard LaTeX documentation package V3 (FMi)]
%\catcode`\<=12
%
Expand Down Expand Up @@ -972,9 +972,23 @@
% index entries \\
% \hspace*{30pt} Special macros for \*
% \end{quote}
% Such an entry might be produced with the line:
% Such an entry might be produced with the line
%\begin{verbatim}
% \index{index entries\levelchar Special macros for \*}
% \index{index entries>Special macros for \*}
%\end{verbatim}
% assuming that \verb=>= is the \cs{levelchar} used by the index
% processor.

% You can't use \cs{levelchar} in this situation because if \cs{index}
% is directly used in the document then it's argument is written out
% fully verbatim. However, if you define your own index commands,
% expansion will happen on the way to the \texttt{.idx} file; and in
% that case you can use \cs{levelchar}---this is what the \pkg{doc}
% macros do. This then allows to change the indexing syntax easily, e.g.,
%\begin{verbatim}
% \newcommand\ltxconcept[2]{\index{#1\levelchar#2}}
% ...
% \ltxconcept{index entries}{Special macros for \*}
%\end{verbatim}
%
%
Expand Down
54 changes: 54 additions & 0 deletions base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,17 @@ \subsection{Fixing the spacing after display math}

\section{New or improved commands}

\subsection{Socket and plug conditionals}

It is sometimes necessary/helpful to know if a particular socket or
plug exists (or is assigned to a certain socket) and based on that
take different actions. With the current release we added
conditionals, such as \cs{IfSocketExistsTF}, to support such
scenarios. Corresponding L3 programming layer conditionals are also
provided.
%
\githubissue{1577}

\section{Code improvements}

\subsection{Refinement of \cs{MakeTitlecase}}
Expand Down Expand Up @@ -370,6 +381,30 @@ \subsection{Fix the use of \texttt{localmathalpabets}}
%
\githubissue[s]{1101 1028}

\subsection{\pkg{docstrip}:\ Error if \texttt{.ins} file is problematical}

If a file to generate had the same name as a preamble declared with
\cs{declarepreamble} the preamble definition was overwritten because
the macro used to store it was reused for denoting the output
stream. The same problem happened with postambles declared with
\cs{declarepostamble}. This is now detected and an error message is
issued. To circumvent the issue in that case, simply use a different
macro name for the preamble or postamble.
%
\githubissue{1150}


\subsection{Prevent \texttt{cmd} hook from defining an undefined command}

Using \verb=\AddToHook{cmd/FOO/...}= when the command \cs{FOO} was
undefined resulted in the command becoming \cs{relax}. Thus, if used,
it no longer raised an \enquote{Undefined control sequence} error but silently
did nothing. This behavior has been corrected and if the command
\cs{FOO} isn't defined later, e.g., in a package, it now raises an
error if it is used in the document.
%
\githubissue{1591}


%\section{Changes to packages in the \pkg{amsmath} category}

Expand All @@ -391,6 +426,25 @@ \subsection{\pkg{multicol}:\ Full support for extended marks}



\subsection{\pkg{array}:\ Improve preamble setup code for \texttt{p} and friends}

While the preamble of a \env{tabular} or \env{array} is being built
the arguments to \texttt{p}, \texttt{m}, or \texttt{b} columns were
expanded several times. That is normally harmless because that
argument contains usually just a dimension. However, in a case like
\verb=p{\fpeval{15}pt}= this resulted in an error, because \cs{fpeval}
was expanded a few times, but not often enough to result in a single
number. This has now been corrected and the argument is not expanded
at all to allow for such edge cases as well as the extension available
with the \pkg{calc} package, such as \verb=p{\widthof{AAAAAA}}= (the
latter was possible before but needed to be taken into account while
the correction was implemented.
%
\githubissue{1585}




%\section{Changes to files in the \pkg{cyrillic} category}

\begin{thebibliography}{9}\frenchspacing
Expand Down
35 changes: 32 additions & 3 deletions base/docstrip.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
\catcode`\{=1
\catcode`\}=2
\def\filename{docstrip.dtx}
\def\fileversion{v2.6b}
\def\filedate{2022-09-03}
\def\docdate {2024-02-08}
\def\fileversion{v2.6c}
\def\filedate{2024-12-23}
\def\docdate {2024-12-23}
%%
%
%\iffalse
Expand Down Expand Up @@ -3027,8 +3027,37 @@ Z
% defining preamble for the current file.
% \begin{macrocode}
\def\@fileX#1#2{%
% \end{macrocode}
% If the csname used for the stream has already been defined, e.g.,
% as a preamble or postamble or for some other purposes, chances are
% that turning it into a stream number will break something. We
% therefore generate an error and show the current definition.
% \changes{v2.6c}{2024-12-23}{Check that stream macro is not already
% used (gh/1150)}
% \begin{macrocode}
\ifx#1\relax \else
\errmessage{Command \string#1 for denoting the output \noexpand
\file stream already defined!^^J
\space Current meaning is:^^J^^J\meaning#1^^J^^J
\space Extraction will probably fail - check result}%
\fi
\chardef#1=\stream@closed
\def\curout{#1}%
% \end{macrocode}
% If it matches the name of the current preamble or postamble then
% it definitely can't work, so we call that out explicitly:
% \begin{macrocode}
\ifx\curout\currentpreamble
\errmessage{Declared preamble name \string#1 not allowed if
\string\file{\@stripstring#1} is used}%
\fi
\ifx\curout\currentpostamble
\errmessage{Declared postamble name \string#1 not allowed if
\string\file{\@stripstring#1} is used}%
\fi
% \end{macrocode}
%
% \begin{macrocode}
\let\curinfiles\empty
\let\curinnames\empty
\def\curref{\MetaPrefix ^^J%
Expand Down
10 changes: 5 additions & 5 deletions base/ltcmd.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
%
% \begin{macrocode}
\def\ltcmdversion{v1.2f}
\def\ltcmddate{2024-12-12}
\def\ltcmddate{2024-12-25}
% \end{macrocode}
%
%<*driver>
Expand Down Expand Up @@ -2254,7 +2254,7 @@
%
% \changes{v1.1c}{2023/03/12}
% {Distinguish (non-expandable) document commands starting with
% \cs{@@_start_expandable:nNNNNn}}
% \cs{__cmd_start_expandable:nNNNNn}}
% There's one variant: a command begins with \cs{@@_start_expandable:nNNNNn}
% may still be un-expandable/protected if it's defined by
% \cs{NewDocumentCommand} and friends, with empty or only m-type arguments.
Expand Down Expand Up @@ -2605,7 +2605,7 @@
%
% \changes{v1.1c}{2023/03/12}
% {Distinguish (non-expandable) document commands starting with
% \cs{@@_start_expandable:nNNNNn}}
% \cs{__cmd_start_expandable:nNNNNn}}
% There's one variant: a command begins with \cs{@@_start_expandable:nNNNNn}
% may still be un-expandable/protected if it's defined by
% \cs{NewDocumentCommand} and friends, with empty or only m-type arguments.
Expand Down Expand Up @@ -4568,9 +4568,9 @@
% \begin{macro}{\@@_cmd_type_cases:NnnnnnF}
% \changes{v1.0d}{2021/04/19}{Renamed \cs{__cmd_cmd_if_xparse:NTF} to
% \cs{__kernel_cmd_if_xparse:NTF} for cross-module usage}
% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:NnnnnF} for
% \changes{v1.0d}{2021/07/30}{Added \cs{__cmd_cmd_type_cases:NnnnnF} for
% \cs{NewCommandCopy} and \cs{ShowCommand} support}
% \changes{v1.0l}{2022/03/18}{Fix \cs{@@_cmd_type_cases:NnnnnF}
% \changes{v1.0l}{2022/03/18}{Fix \cs{__cmd_cmd_type_cases:NnnnnF}
% prematurely expanding macros (gh/795)}
% \changes{v1.2b}{2023/12/01}{Extend for optimized commands}
% \changes{v1.2e}{2024/04/17}{Use \cs{__kernel_cs_parameter_spec:N} instead
Expand Down
55 changes: 44 additions & 11 deletions base/ltcmdhooks.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%<*driver>
% \fi
\ProvidesFile{ltcmdhooks.dtx}
[2024/12/12 v1.0j LaTeX Kernel (Command hooks)]
[2024/12/25 v1.0k LaTeX Kernel (Command hooks)]
% \iffalse
%
\documentclass{l3doc}
Expand Down Expand Up @@ -513,7 +513,7 @@
% \begin{macro}{\c_@@_hash_tl,\c_@@_hashes_tl}
% Two constant token lists that contain one and two parameter tokens.
% \changes{v1.0g}{2023/04/06}
% {Rename to \cs{c_@@_hashes_tl} and add \cs{c_@@_hash_tl} (hook-args).}
% {Rename to \cs{c__hook_hashes_tl} and add \cs{c__hook_hash_tl} (hook-args)}
% \begin{macrocode}
\tl_const:Nn \c_@@_hash_tl { # }
\tl_const:Nn \c_@@_hashes_tl { # # }
Expand Down Expand Up @@ -577,20 +577,53 @@
% otherwise it tries to update the hook.
% \changes{v1.0d}{2021/08/25}{Simplify generic hook detection}
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_put_cmd_hook:n}%
%<latexrelease> {Standardise~generic~hook~names}
%<latexrelease>\IncludeInRelease{2024/12/22}{\@@_try_put_cmd_hook:n}%
%<latexrelease> {Don't~define~command}
\cs_new_protected:Npn \@@_try_put_cmd_hook:n #1
{ \@@_try_put_cmd_hook:w #1 / / / \s_@@_mark {#1} }
\cs_new_protected:Npn \@@_try_put_cmd_hook:w
#1 / #2 / #3 / #4 \s_@@_mark #5
{
\@@_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } }
\exp_args:Nc \@@_patch_cmd_or_delay:Nnn {#2} {#2} {#3}
% \end{macrocode}
% \cs{@@_patch_cmd_or_delay:Nnn} expects the command to be patched
% as its first argument so we need to construct it from its name
% (\texttt{\#2}). However, at this moment it may not exist yet, so
% using \cs{cs:w} would incorrectly turn it from
% \enquote{undefined} into \cs{relax}. We therefore use the
% following curious construction: we start a group and expand out of
% it to call \cs{cs:w}. If the command is now changed to \cs{relax}
% the \cs{group_end:} will undo that change, but the token is
% nevertheless there to be consumed by \cs{@@_patch_cmd_or_delay:Nnn}.
% \changes{v1.0k}{2024/12/22}{Avoid defining command while adding a cmd
% hook (gh/1591)}
% \begin{macrocode}
\group_begin:
\exp_after:wN
\group_end:
\exp_after:wN
\@@_patch_cmd_or_delay:Nnn
\cs:w #2\cs_end:
{#2} {#3}
}
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_put_cmd_hook:n}%
%<latexrelease> {Standardise~generic~hook~names}
%<latexrelease>\cs_new_protected:Npn \@@_try_put_cmd_hook:n #1
%<latexrelease> { \@@_try_put_cmd_hook:w #1 / / / \s_@@_mark {#1} }
%<latexrelease>\cs_new_protected:Npn \@@_try_put_cmd_hook:w
%<latexrelease> #1 / #2 / #3 / #4 \s_@@_mark #5
%<latexrelease> {
%<latexrelease> \@@_debug:n { \iow_term:n { ->~Adding~cmd~hook~to~'#2'~(#3): } }
%<latexrelease> \exp_args:Nc \__hook_patch_cmd_or_delay:Nnn {#2} {#2} {#3}
%<latexrelease> }
%<latexrelease>\EndIncludeInRelease
% \end{macrocode}
%
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2021/06/01}{\@@_try_put_cmd_hook:n}%
%<latexrelease> {Standardise~generic~hook~names}
%<latexrelease>\cs_new_protected:Npn \@@_try_put_cmd_hook:n #1
Expand Down Expand Up @@ -849,7 +882,7 @@
%
% \changes{v1.0f}{2021/10/20}
% {Correct patching by expansion+redefinition when the macro
% contains a parameter token (gh/697).}
% contains a parameter token (gh/697)}
% Patching with expansion+redefinition is trickier than it looks like
% at first glance. Suppose the simple definition:
% \begin{verbatim}
Expand Down Expand Up @@ -964,7 +997,7 @@
% Here we'll conditionally add |[|\ldots|]| around the first
% parameter:
% \changes{v1.0g}{2023/04/06}
% {Rename to \cs{c_@@_hashes_tl} (hook-args).}
% {Rename to \cs{c__hook_hashes_tl} (hook-args)}
% \begin{macrocode}
\bool_if:NTF #1
{ \@@_tmp:w \tl_set:Nx { [ \c_@@_hashes_tl 1 ] } }
Expand Down Expand Up @@ -1032,7 +1065,7 @@
% the extent we want. Code stored in the hook and other metadata
% about it are not lost in the process.
% \changes{v1.0h}{2023/05/21}
% {Changes to allow support arguments in cmd hooks (cmd-args).}
% {Changes to allow support arguments in cmd hooks (cmd-args)}
% \begin{macrocode}
\@@_disable:n { cmd / #3 / #4 }
\cs_undefine:c { c_@@_cmd / #3 / #4_parameter_tl }
Expand Down Expand Up @@ -1242,7 +1275,7 @@
% then checks if the token is \cs{c_@@_hashes_tl}, and if so just leaves
% it.
% \changes{v1.0g}{2023/04/06}
% {Add case for \cs{c_@@_hashes_tl} (hook-args).}
% {Add case for \cs{c__hook_hashes_tl} (hook-args)}
% \begin{macrocode}
\cs_new:Npn \@@_double_hashes_output:N #1
{
Expand Down Expand Up @@ -1543,7 +1576,7 @@
% hashes, and not other characters, and that there is no
% \enquote{trick parameter}.
% \changes{v1.0h}{2023/05/21}
% {Macro added (cmd-args).}
% {Macro added (cmd-args)}
% \begin{macrocode}
%<latexrelease>\IncludeInRelease{2023/06/01}{\@@_guess_arg_count:NN}
%<latexrelease> {cmd~hooks~with~args}
Expand Down Expand Up @@ -1592,7 +1625,7 @@
% Here, when patching by retokenization, we can only guess the number
% of arguments of the macro.
% \changes{v1.0h}{2023/05/21}
% {Changes to allow support arguments in cmd hooks (cmd-args).}
% {Changes to allow support arguments in cmd hooks (cmd-args)}
% \begin{macrocode}
\@@_guess_arg_count:NN #1 \l_@@_patch_num_args_int
% \end{macrocode}
Expand Down
Loading

0 comments on commit b6c8994

Please sign in to comment.