[latex3-commits] [latex3/latex3] main: Normalise .inherit:n input (fixes #1314) (2fe00406a)

github at latex-project.org github at latex-project.org
Wed Nov 1 22:45:47 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/2fe00406a08ad517415dbd970fe8d3686eec95ab

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

commit 2fe00406a08ad517415dbd970fe8d3686eec95ab
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Nov 1 21:45:47 2023 +0000

    Normalise .inherit:n input (fixes #1314)


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

2fe00406a08ad517415dbd970fe8d3686eec95ab
 l3kernel/CHANGELOG.md            |  3 +++
 l3kernel/l3keys.dtx              | 11 ++++++++++-
 l3kernel/testfiles/m3keys003.lvt |  7 ++++++-
 l3kernel/testfiles/m3keys003.tlg |  3 +++
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 43a783d0b..4b4be2d61 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Fixed
+- Normalisation of `.inherit:n` key data (issue \#1314)
+
 ## [2023-11-01]
 
 ### Added
diff --git a/l3kernel/l3keys.dtx b/l3kernel/l3keys.dtx
index 157a41b29..808aa9bce 100644
--- a/l3kernel/l3keys.dtx
+++ b/l3kernel/l3keys.dtx
@@ -1578,6 +1578,13 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \begin{variable}{\l_@@_inherit_clist}
+%   For normalisation.
+%    \begin{macrocode}
+\clist_new:N \l_@@_inherit_clist
+%    \end{macrocode}
+% \end{variable}
+%
 % \begin{variable}{\l_keys_key_str, \l_keys_key_tl}
 %   The name of a key itself: needed when setting keys. The |tl| version
 %   is deprecated but has to be handled manually.
@@ -2080,7 +2087,9 @@
 \cs_new_protected:Npn \@@_inherit:n #1
   {
     \@@_undefine:
-    \cs_set_nopar:cpn { \c_@@_inherit_root_str \l_keys_path_str } {#1}
+    \clist_set:Nn \l_@@_inherit_clist {#1}
+    \cs_set_eq:cN { \c_@@_inherit_root_str \l_keys_path_str }
+      \l_@@_inherit_clist
   }
 %    \end{macrocode}
 % \end{macro}
diff --git a/l3kernel/testfiles/m3keys003.lvt b/l3kernel/testfiles/m3keys003.lvt
index 868d2d740..12867a8b0 100644
--- a/l3kernel/testfiles/m3keys003.lvt
+++ b/l3kernel/testfiles/m3keys003.lvt
@@ -165,7 +165,8 @@
       }
     \keys_define:nn { module-two }
       {
-        path .inherit:n = module
+        path  .inherit:n = module ,
+        pathb .inherit:n = { ~ module , module ~ }
       }
     \keys_set:nn { module-two / path }
       {
@@ -178,6 +179,10 @@
         key-not-defined = a ,
         key-two = c
       }
+    \keys_set:nn { module-two / pathb }
+      {
+        key-one = inherited
+      }
   }
 
 \END
diff --git a/l3kernel/testfiles/m3keys003.tlg b/l3kernel/testfiles/m3keys003.tlg
index 47ad2af6f..042601fa1 100644
--- a/l3kernel/testfiles/m3keys003.tlg
+++ b/l3kernel/testfiles/m3keys003.tlg
@@ -154,4 +154,7 @@ For immediate help type H <return>.
 l. ...  }
 The key 'module-two/path/key-two' only accepts predefined values, and 'c' is
 not one of these.
+> inherited.
+<recently read> }
+l. ...  }
 ============================================================





More information about the latex3-commits mailing list.