[latex3-commits] [git/LaTeX3-latex3-latex3] main: Add \sys_ensure_backend: (a82178581)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Jul 29 17:31:36 CEST 2022


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

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

commit a82178581be983fda3f590bf77026b9f9590ac75
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jul 29 16:31:32 2022 +0100

    Add \sys_ensure_backend:


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

a82178581be983fda3f590bf77026b9f9590ac75
 l3kernel/CHANGELOG.md |  1 +
 l3kernel/l3sys.dtx    | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 90091102a..42531294c 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 
 ### Added
 - Support for case changing Croatian diagraph with 8-bit engines
+- Function `\sys_ensure_backend:`
 
 ## [2022-07-21]
 
diff --git a/l3kernel/l3sys.dtx b/l3kernel/l3sys.dtx
index a25c0867a..ef25d45e9 100644
--- a/l3kernel/l3sys.dtx
+++ b/l3kernel/l3sys.dtx
@@ -290,6 +290,14 @@
 %   use will be loaded. This command may only be used once.
 % \end{function}
 %
+% \begin{function}[added = 2022-07-29]{\sys_ensure_backend:}
+%   \begin{syntax}
+%     \cs{sys_ensure_backend:}
+%   \end{syntax}
+%   Ensures that a backend has been loaded by calling \cs{sys_load_backend:n}
+%   if required.
+% \end{function}
+%
 % \begin{variable}{\c_sys_backend_str}
 %   Set to the name of the backend in use by \cs{sys_load_backend:n} when
 %   issued.
@@ -561,6 +569,17 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\sys_ensure_backend:}
+%   A simple wrapper.
+%    \begin{macrocode}
+\cs_new_protected:Npn \sys_ensure_backend:
+  {
+    \str_if_exist:NF \c_sys_backend_str
+      { \sys_load_backend:n { } }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{variable}{\g_@@_debug_bool}
 %    \begin{macrocode}
 \bool_new:N \g_@@_debug_bool





More information about the latex3-commits mailing list.