[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Drop \ProcessKeyPackageOptions (ba246a87)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Mar 18 14:29:10 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/ba246a87310372784ed0a2fb9d01ff36e6735176

>---------------------------------------------------------------

commit ba246a87310372784ed0a2fb9d01ff36e6735176
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Mar 18 13:29:10 2022 +0000

    Drop \ProcessKeyPackageOptions


>---------------------------------------------------------------

ba246a87310372784ed0a2fb9d01ff36e6735176
 base/changes.txt      |  5 +++++
 base/doc/ltnews35.tex |  4 +---
 base/ltclass.dtx      |  5 +++--
 base/ltkeys.dtx       | 52 +++++++++++++++++++--------------------------------
 4 files changed, 28 insertions(+), 38 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index b9bea0a5..5dbde25d 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2022-03-18  Joseph Wright  <joseph.wright at latex-project.org>
+
+	* ltkeys.dtx:
+	Remove \ProcessKeyPackageOptions
+
 2022-03-10  Phelype Oleinik  <phelype.oleinik at latex-project.org>
 
 	* ltfilehook.dtx (subsection{Selecting a file (\cs{set at curr@file})}):
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 427d932a..3a2f91d7 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -244,8 +244,6 @@ unless explicitly given as an optional argument.
 \begin{verbatim}
 \ProcessKeyOptions[family]
 \end{verbatim}
-A version which does not consider global options,
-\cs{ProcessKeyPackageOptions}, is also available.
 
 To support creating key options for this mechanism, the new command
 \cs{DeclareKeys} has been added. This works using the same general
@@ -255,7 +253,7 @@ approach as \pkg{l3keys} or \pkg{pgfkeys}: each key has one or more
 Options for packages which use this new approach will not be checked for
 clashes by the kernel. Instead, each time a \cs{usepackage} or
 \cs{RequirePackage} line is encountered, the list of options given will be
-passed to \cs{ProcessKeyPackageOptions}. Options which can only be given
+passed to \cs{ProcessKeyOptions}. Options which can only be given
 the first time a package is loaded can be marked using the property
 \texttt{.usage = load}, and will result in a warning if used in a subsequent
 package loading line.
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 0ff3f711..4ddb6ba6 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2021/12/09 v1.5a LaTeX Kernel (Class & Package Interface)]
+             [2022/03/18 v1.5b LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -2175,6 +2175,7 @@
 %    \begin{macrocode}
   \@ifl at aded\@currext\@currname
 %    \end{macrocode}
+% \changes{v1.5b}{2022/03/18}{Switch to \cs{ProcessKeyOptions}}
 %    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 with the new ones, then call the key handler.
@@ -2185,7 +2186,7 @@
         {\@onefilewithoptions at clashchk{#2}}
         {%
           \@namedef{opt@\@currname.\@currext}{#2}%
-          \expandafter\expandafter\expandafter\ProcessKeyPackageOptions
+          \expandafter\expandafter\expandafter\ProcessKeyOptions
             \expandafter\expandafter\expandafter
               [\csname opt at fam@\@currname.\@currext\endcsname]%
         }%
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index c606d828..00c26002 100644
--- a/base/ltkeys.dtx
+++ b/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 at 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 at 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}
 %





More information about the latex3-commits mailing list.