[latex3-commits] [git/LaTeX3-latex3-latex2e] hotgix/gh885: Support \CurrentOption for unknown keyval options (5dbe4655)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Jul 5 10:21:59 CEST 2022
Repository : https://github.com/latex3/latex2e
On branch : hotgix/gh885
Link : https://github.com/latex3/latex2e/commit/5dbe4655f1a2acaea33783e3dc8048035dbb5cc6
>---------------------------------------------------------------
commit 5dbe4655f1a2acaea33783e3dc8048035dbb5cc6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Jul 5 09:21:59 2022 +0100
Support \CurrentOption for unknown keyval options
>---------------------------------------------------------------
5dbe4655f1a2acaea33783e3dc8048035dbb5cc6
base/changes.txt | 5 +++++
base/ltkeys.dtx | 6 ++++--
base/testfiles/github-0885.lvt | 24 ++++++++++++++++++++++
.../github-0675.tlg => testfiles/github-0885.tlg} | 6 +++---
4 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index eeb9833e..f7809e03 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,11 @@ are not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================
+2022-06-20 Joseph Wright <Joseph.Wright at latex-project.org>
+
+ * ltkeys.dtx (subsection{Main mechanism})
+ Support \CurrentOption in unknown keys
+
#########################
# 2022-06-01 PL4 Release
########################
diff --git a/base/ltkeys.dtx b/base/ltkeys.dtx
index fbd5ce30..d89895fb 100644
--- a/base/ltkeys.dtx
+++ b/base/ltkeys.dtx
@@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{ltkeys.dtx}
- [2022/06/20 v1.0h LaTeX Kernel (Kevyal options)]
+ [2022/07/05 v1.0i LaTeX Kernel (Kevyal options)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{ltkeys.dtx}
@@ -205,6 +205,7 @@
% \begin{macro}{\@@_options_aux:n}
% \changes{v1.0b}{2022/01/15}
% {Clear option list in end-of-package hook}
+% \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
% options into \cs{l_@@_options_clist} before calling the
@@ -239,7 +240,8 @@
{ \keys_define:nn {#1} { unknown .undefine: } }
}
\bool_set_true:N \l_@@_options_loading_bool
- \keys_set:nV {#1} \l_@@_options_clist
+ \clist_map_variable:NNn \l_@@_options_clist \CurrentOption
+ { \keys_set:nV {#1} \CurrentOption }
\bool_set_false:N \l_@@_options_loading_bool
\AtEndOfPackage { \cs_set_eq:NN \@unprocessedoptions \scan_stop: }
\@@_option_end:
diff --git a/base/testfiles/github-0885.lvt b/base/testfiles/github-0885.lvt
new file mode 100644
index 00000000..00d5a0ce
--- /dev/null
+++ b/base/testfiles/github-0885.lvt
@@ -0,0 +1,24 @@
+\documentclass{article}
+
+\begin{filecontents*}[overwrite]{testpackage.sty}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+\ProvidesExplPackage{testpackage}{2022/07/03}{}{}
+\keys_define:nn { testpackage }
+ {
+ , unknown .code:n = { \edef \testmacro { \CurrentOption } }
+ }
+\ProcessKeyOptions [ testpackage ]
+\endinput
+\end{filecontents*}
+
+\input{test2e}
+
+\usepackage[testoption]{testpackage}
+
+\begin{document}
+
+\START
+
+\show\testmacro
+
+\END
diff --git a/base/testfiles-lthooks/github-0675.tlg b/base/testfiles/github-0885.tlg
similarity index 63%
copy from base/testfiles-lthooks/github-0675.tlg
copy to base/testfiles/github-0885.tlg
index cb25ed26..d057db0a 100644
--- a/base/testfiles-lthooks/github-0675.tlg
+++ b/base/testfiles/github-0885.tlg
@@ -1,5 +1,5 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
-bar
-foo
-baz
+> \testmacro=macro:
+->testoption.
+l. ...\show\testmacro
More information about the latex3-commits
mailing list.