diff --git a/base/changes.txt b/base/changes.txt index 080a33889..eb52d03e7 100644 --- a/base/changes.txt +++ b/base/changes.txt @@ -16,6 +16,12 @@ are not part of the distribution. * ltkeys.dtx: Correct handling of unknown option list +2022-10-20 Joseph Wright + + * ltclass.dtx, ltkeys.dtx: + Correct an argument for a message + Define key option handler in ltkeys + 2022-10-10 David Carlisle * ltclass.dtx: use \protected@edef rather than \edef when expanding option lists diff --git a/base/ltclass.dtx b/base/ltclass.dtx index 8d946a326..a525b6f57 100644 --- a/base/ltclass.dtx +++ b/base/ltclass.dtx @@ -2186,13 +2186,15 @@ % \end{macrocode} % \changes{v1.5b}{2022/03/18}{Switch to \cs{ProcessKeyOptions}} % \changes{v1.5c}{2022/06/20}{Pass raw options to \cs{ProcessKeyOptions}} +% \changes{v1.5e}{2022/10/20} +% {Define key option handler in \pkg{ltkeys}} % In the current preferred approach, a key family name will exist for % processing using \pkg{ltkeys}. In that case, we replace the previous % package options with the new ones, then call the key handler. % Otherwise, we use the more classical clash handler. % \begin{macrocode} {% - \@ifundefined{opt@fam@\@currname.\@currext} + \@ifundefined{opt@handler@\@currname.\@currext} {\@onefilewithoptions@clashchk{#2}} {% % \end{macrocode} @@ -2201,9 +2203,7 @@ \expandafter\protected@edef\csname opt@\@currname.\@currext\endcsname {\zap@space#2 \@empty}% \@namedef{@raw@opt@\@currname.\@currext}{#2}% - \expandafter\expandafter\expandafter\ProcessKeyOptions - \expandafter\expandafter\expandafter - [\csname opt@fam@\@currname.\@currext\endcsname]% + \@nameuse{opt@handler@\@currname.\@currext}% }% }% {\makeatletter diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx index b418aa353..edf12f7cb 100644 --- a/base/ltkeys.dtx +++ b/base/ltkeys.dtx @@ -209,6 +209,8 @@ % \begin{macro}{\@@_options_aux:n} % \changes{v1.0b}{2022/01/15} % {Clear option list in end-of-package hook} +% \changes{v1.0l}{2022/10/20} +% {Define key option handler in \pkg{ltkeys}} % \changes{v1.0i}{2022/07/05}{Support \cs{CurrentOption}} % \begin{macro}{\@@_options_end:} % The main function calls functions to collect up the global and local @@ -225,7 +227,8 @@ { \@@_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_gset_protected:cpn { opt@handler@\@currname.\@currext } + { \ProcessKeyOptions [ #1 ] } \cs_set_protected:Npn \@@_option_end: { } \clist_clear:N \l_@@_options_clist \@@_options_global:n {#1} @@ -477,6 +480,7 @@ % % \begin{macro}{\@@_options_loaded:n} % \begin{macro}{\@@_options_loaded:nn} +% \changes{v1.0l}{2022/10/20}{Correct an argument for a message} % Indicates that the load-time options for a package have been processed: % once this has happened, make them unavailable either with a warning or % an error. @@ -498,11 +502,9 @@ \cs_new_protected:Npn \@@_options_loaded:nn #1#2 { \bool_if:NTF \l_@@_options_loading_bool - { - \msg_warning:nnxx { keys } { load-option-ignored } - { \use:c { opt@fam@\@currname.\@currext } } {#2} - } - { \msg_error:nnnn { keys } { load-only } {#1} {#2} } + { \msg_warning:nnnn { keys } { load-option-ignored } } + { \msg_error:nnnn { keys } { load-only } } + {#1} {#2} } % \end{macrocode} % \changes{v1.0j}{2022/07/23}