diff options
Diffstat (limited to 'macros/latex-dev/base/ltkeys.dtx')
-rw-r--r-- | macros/latex-dev/base/ltkeys.dtx | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/macros/latex-dev/base/ltkeys.dtx b/macros/latex-dev/base/ltkeys.dtx index c606d8284d..00c2600289 100644 --- a/macros/latex-dev/base/ltkeys.dtx +++ b/macros/latex-dev/base/ltkeys.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltkeys.dtx} - [2022/02/21 v1.0e LaTeX Kernel (Kevyal options)] + [2022/02/21 v1.0f LaTeX Kernel (Kevyal options)] % \iffalse \documentclass{l3doc} \GetFileInfo{ltkeys.dtx} @@ -99,8 +99,8 @@ % \texttt{second-name} can be given anywhere, and will save its value in % \cs{@mypkg@other@name}. % -% Keys created \emph{before} the use of -% \cs{ProcessKeyOptions}/\cs{ProcessKeyPackageOptions} act as package options. +% Keys created \emph{before} the use of \cs{ProcessKeyOptions}act as +% package options. % \end{function} % % \begin{function}{\DeclareUnknownKeyHandler} @@ -124,17 +124,6 @@ % is called in a package. % \end{function} % -% \begin{function}{\ProcessKeyPackageOptions} -% \begin{syntax} -% \cs{ProcessKeyPackageOptions} \oarg{family} -% \end{syntax} -% This function works in a similar manner to \cs{ProcessKeyOptions}. -% When used in a package, \cs{ProcessKeyPackageOptions} -% will not examine any global (class) class options available. In contrast, -% \cs{ProcessKeyOptions} does parse class options (in common with the -% classical \cs{ProcessOptions} command). -% \end{function} -% % \begin{function}{\SetKeys} % \begin{syntax} % \cs{SetKeys} \oarg{family} \Arg{keyvals} @@ -142,7 +131,7 @@ % Sets (applies) the explicit list of \meta{keyvals} for the \meta{family}: % it the latter is not given, the value of \cs{@currname} used. This command % may be used within a package to set options before or after using -% \cs{ProcessKeyOptions}/\cs{ProcessKeyPackageOptions}. +% \cs{ProcessKeyOptions}. % \end{function} % % \StopEventually{} @@ -211,8 +200,9 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_options:Nn} -% \begin{macro}{\@@_options:nN} +% \begin{macro}{\@@_options:n} +% \changes{v1.0f}{2022/03/18}{Simplify to always cover global options} +% \begin{macro}{\@@_options_aux:n} % \changes{v1.0b}{2022/01/15} % {Clear option list in end-of-package hook} % \begin{macro}{\@@_options_end:} @@ -226,14 +216,14 @@ % with the key family not matching the file name, we store the family % in all cases. % \begin{macrocode} -\cs_new_protected:Npn \@@_options:Nn #1#2 - { \@@_options_expand_module:Nn \@@_options:nN {#2} #1 } -\cs_new_protected:Npn \@@_options:nN #1#2 +\cs_new_protected:Npn \@@_options:n #1 + { \@@_options_expand_module:Nn \@@_options_aux:n {#1} } +\cs_new_protected:Npn \@@_options_aux:n #1 { \cs_gset_nopar:cpn { opt@fam@\@currname.\@currext } {#1} \cs_set_protected:Npn \@@_option_end: { } \clist_clear:N \l_@@_options_clist - \@@_options_global:Nn #2 {#1} + \@@_options_global:n {#1} \@@_options_local: \keys_if_exist:nnF {#1} { unknown } { @@ -266,23 +256,21 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_options_global:Nn} +% \begin{macro}{\@@_options_global:n} +% \changes{v1.0f}{2022/03/18}{Simplify to always cover global options} % Global (class) options are handled differently for \LaTeXe{} packages % and classes. Hence this function is essentially a check on the current % file type. The initial test is needed as \LaTeXe{} allows variables to % be equal to \cs{scan_stop:}, which is usually forbidden in \pkg{expl3} % code. % \begin{macrocode} -\cs_new_protected:Npn \@@_options_global:Nn #1#2 +\cs_new_protected:Npn \@@_options_global:n #1 { \cs_if_eq:NNF \@classoptionslist \scan_stop: { \cs_if_eq:NNTF \@currext \@clsextension - { \@@_options_class:n {#2} } - { - \bool_if:NT #1 - { \@@_options_package:n {#2} } - } + { \@@_options_class:n {#1} } + { \@@_options_package:n {#1} } } } % \end{macrocode} @@ -427,20 +415,18 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\ProcessKeyOptions, \ProcessKeyPackageOptions} +% \begin{macro}{\ProcessKeyOptions} % \changes{v1.0c}{2022/02/15}{Expand module argument} % \changes{v1.0d}{2022/02/16}{Allow for active characters in module argument} +% \changes{v1.0f}{2022/03/18}{Remove \cs{ProcessKeyPackageOptions}} % We need to deal with the older interface from \pkg{l3keys2e} here: it had % a mandatory argument. We can mop that up using a look-ahead, and then % exploit that information to determine whether the package option handling % is set up for the new approach for clash handling. % \begin{macrocode} \NewDocumentCommand \ProcessKeyOptions { O { \@currname } } - { \@@_options:Nn \c_true_bool {#1} } -\NewDocumentCommand \ProcessKeyPackageOptions { O { \@currname } } - { \@@_options:Nn \c_false_bool {#1} } + { \@@_options:n {#1} } \@onlypreamble \ProcessKeyOptions -\@onlypreamble \ProcessKeyPackageOptions % \end{macrocode} % \end{macro} % |