[latex3-commits] [git/LaTeX3-latex3-latex3] main: Allow for colors going out-of-scope (47c4dc52d)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jan 20 08:37:06 CET 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/47c4dc52d8222bc237987019f643db6b2ff09421

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

commit 47c4dc52d8222bc237987019f643db6b2ff09421
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jan 20 07:37:06 2022 +0000

    Allow for colors going out-of-scope


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

47c4dc52d8222bc237987019f643db6b2ff09421
 l3kernel/CHANGELOG.md | 1 +
 l3kernel/l3color.dtx  | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index aa54076d7..38a52e538 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -13,6 +13,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Fixed
 - Correct creation of `.if` property
+- Handling of colors created in a group once they go out-of-scope
 
 ## [2022-01-12]
 
diff --git a/l3kernel/l3color.dtx b/l3kernel/l3color.dtx
index b4dab46a7..a84dea317 100644
--- a/l3kernel/l3color.dtx
+++ b/l3kernel/l3color.dtx
@@ -600,12 +600,17 @@
 %
 % \begin{macro}[TF, EXP]{\@@_if_defined:n}
 %   A simple wrapper to avoid needing to have the lookup repeated in too many
-%   places.
+%   places.To guard against a color created in a group, we need to test for
+%   entries in the |prop|.
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \@@_if_defined:n #1 { T, F, TF }
   {
     \prop_if_exist:cTF { l_@@_named_ #1 _prop }
-      \prg_return_true:
+      {
+        \prop_if_empty:cTF { l_@@_named_ #1 _prop }
+          \prg_return_false:
+          \prg_return_true:
+      }
       \prg_return_false:
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list.