summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltcmd.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltcmd.dtx')
-rw-r--r--macros/latex-dev/base/ltcmd.dtx153
1 files changed, 4 insertions, 149 deletions
diff --git a/macros/latex-dev/base/ltcmd.dtx b/macros/latex-dev/base/ltcmd.dtx
index d6322ff3ee..dcb85a1ae8 100644
--- a/macros/latex-dev/base/ltcmd.dtx
+++ b/macros/latex-dev/base/ltcmd.dtx
@@ -34,8 +34,8 @@
%%% From File: ltcmd.dtx
%
% \begin{macrocode}
-\def\ltcmdversion{v1.1e}
-\def\ltcmddate{2023-05-26}
+\def\ltcmdversion{v1.2a}
+\def\ltcmddate{2023-08-19}
% \end{macrocode}
%
%<*driver>
@@ -59,6 +59,8 @@
% \section{Creating document commands}
%
% \changes{v1.0a}{2020/11/20}{Initial version derived from \texttt{xparse.dtx}}
+% \changes{v1.2a}{2023/08/19}{Removed commands that should have remained
+% only in \texttt{xparse.dtx}}
%
% Document commands should be created using the tools provided by this module:
% \cs{NewDocumentCommand}, etc.\@, in almost all cases. This allows clean
@@ -4263,116 +4265,6 @@
% \end{macro}
% \end{macro}
%
-% \subsection{Access to the argument specification}
-%
-% \begin{macro}{\@@_get_arg_spec_error:N, \@@_get_arg_spec_error:n}
-% \begin{macro}{\@@_get_arg_spec_error_aux:n}
-% Provide an informative error when trying to get the argument
-% specification of a non-\pkg{xparse} command or environment.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_get_arg_spec_error:N #1
- {
- \bool_set_false:N \l_@@_environment_bool
- \tl_set:Nn \l_@@_fn_tl {#1}
- \@@_get_arg_spec_error_aux:n { \cs_if_exist:NTF #1 }
- }
-\cs_new_protected:Npn \@@_get_arg_spec_error:n #1
- {
- \bool_set_true:N \l_@@_environment_bool
- \str_set:Nx \l_@@_environment_str {#1}
- \@@_get_arg_spec_error_aux:n
- { \cs_if_exist:cTF { \l_@@_environment_str } }
- }
-\cs_new_protected:Npn \@@_get_arg_spec_error_aux:n #1
- {
- #1
- {
- \msg_error:nnx { cmd } { non-xparse }
- { \@@_environment_or_command: }
- }
- {
- \msg_error:nnx { cmd } { unknown }
- { \@@_environment_or_command: }
- }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@@_get_arg_spec:NTF}
-% If the command is not an \pkg{xparse} command, complain. If it is,
-% its second \enquote{item} is the argument specification.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_get_arg_spec:NTF #1#2#3
- {
- \__kernel_cmd_if_xparse:NTF #1
- {
- \tl_set:Nx \ArgumentSpecification { \tl_item:Nn #1 { 2 } }
- #2
- }
- {#3}
- }
-% \end{macrocode}
-% \end{macro}
-%
-% Rolling forward from 2020-10-01 is tricky because the entire |ltcmd|
-% module is new, but the user-level commands have the same name, so only
-% these will clash. To work around that, in |latexrelease| mode we will
-% (temporarily) disable \cs{__kernel_chk_if_free_cs:N} for this final
-% part of the code, then restore at the end.
-% \begin{macrocode}
-%<latexrelease>\cs_new_eq:NN \@@_chk_if_free_cs:N \__kernel_chk_if_free_cs:N
-%<latexrelease>\cs_gset_eq:NN \__kernel_chk_if_free_cs:N \use_none:n
-% \end{macrocode}
-%
-% \begin{variable}{\ArgumentSpecification}
-% \begin{macrocode}
-\tl_new:N \ArgumentSpecification
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{macro}{\@@_get_arg_spec:N}
-% \begin{macro}{\@@_get_arg_spec:n}
-% Recovering the argument specification is now trivial.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_get_arg_spec:N #1
- {
- \@@_get_arg_spec:NTF #1 { }
- { \@@_get_arg_spec_error:N #1 }
- }
-\cs_new_protected:Npn \@@_get_arg_spec:n #1
- {
- \exp_args:Nc \@@_get_arg_spec:NTF
- { environment~ \tl_to_str:n {#1} }
- { }
- { \@@_get_arg_spec_error:n {#1} }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@@_show_arg_spec:N}
-% \begin{macro}{\@@_show_arg_spec:n}
-% Showing the argument specification simply means finding it and then
-% calling the \cs{tl_show:N} function.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_show_arg_spec:N #1
- {
- \@@_get_arg_spec:NTF #1
- { \tl_show:N \ArgumentSpecification }
- { \@@_get_arg_spec_error:N #1 }
- }
-\cs_new_protected:Npn \@@_show_arg_spec:n #1
- {
- \exp_args:Nc \@@_get_arg_spec:NTF
- { environment~ \tl_to_str:n {#1} }
- { \tl_show:N \ArgumentSpecification }
- { \@@_get_arg_spec_error:n {#1} }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \subsection{Utilities}
%
% \begin{macro}{\@@_check_definable:nNT, \@@_check_definable_aux:nN}
@@ -4817,12 +4709,6 @@
LaTeX~did~not~find~this~argument~and~will~insert~a~default~value~
for~further~processing.
}
-\msg_new:nnnn { cmd } { non-xparse }
- { \str_uppercase:n #1~not~defined~using~xparse. }
- {
- You~have~asked~for~the~argument~specification~for~the~#1,~
- but~this~was~not~defined~using~xparse.
- }
\msg_new:nnnn { cmd } { arg-split }
{ Too~many~'#1'~separators~in~argument. }
{
@@ -4830,12 +4716,6 @@
at~each~occurrence~of~the~separator~'#1'~into~#2~parts.~
Too~many~separators~were~found.
}
-\msg_new:nnnn { cmd } { unknown }
- { Unknown~document~#1. }
- {
- You~have~asked~for~the~argument~specification~for~the~#1,~
- but~it~is~not~defined.
- }
\msg_new:nnnn { cmd } { verbatim-nl }
{ Verbatim-like~#1~ended~by~end~of~line. }
{
@@ -5153,31 +5033,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\GetDocumentCommandArgSpec}
-% \begin{macro}{\GetDocumentEnvironmentArgSpec}
-% \begin{macro}{\ShowDocumentCommandArgSpec}
-% \begin{macro}{\ShowDocumentEnvironmentArgSpec}
-% More simple mappings, with a check that the argument is a single
-% control sequence or active character.
-% \begin{macrocode}
-\cs_new_protected:Npn \GetDocumentCommandArgSpec #1
- {
- \@@_check_definable:nNT {#1} \GetDocumentCommandArgSpec
- { \@@_get_arg_spec:N #1 }
- }
-\cs_new_eq:NN \GetDocumentEnvironmentArgSpec \@@_get_arg_spec:n
-\cs_new_protected:Npn \ShowDocumentCommandArgSpec #1
- {
- \@@_check_definable:nNT {#1} \ShowDocumentCommandArgSpec
- { \@@_show_arg_spec:N #1 }
- }
-\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \@@_show_arg_spec:n
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
% Finally as promised, restore \cs{__kernel_chk_if_free_cs:N}:
% \begin{macrocode}
%<latexrelease>\cs_gset_eq:NN \__kernel_chk_if_free_cs:N \@@_chk_if_free_cs:N