From 27ea9a6709bfd6ced4fa225e28525855c5ce2f9d Mon Sep 17 00:00:00 2001
From: mirabilos <m@mirbsd.org>
Date: Sun, 5 Aug 2018 23:26:31 +0200
Subject: [PATCH] rearrange so the unconditional overrides are in a conditional
 block
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

matching how these have been fed back upstream; David Carlisle
said it’ll be merged in, up to, a few weeks
---
 unicodedomino_kernel_cosmetics.def | 32 ++++++++++++++----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/unicodedomino_kernel_cosmetics.def b/unicodedomino_kernel_cosmetics.def
index a68f9d1..a21165f 100644
--- a/unicodedomino_kernel_cosmetics.def
+++ b/unicodedomino_kernel_cosmetics.def
@@ -20,20 +20,26 @@
 %
 % This file is dual-licenced under the LPPL version 1.3c or later.
 %-
-% Improve error and warning formatting.
+% Improve error and warning formatting. Fully submitted upstream.
 
 %: https://github.com/latex3/latex2e/pull/62
-% format a number as two-digit hex
 \ifx\UTFviii@hexbyte\@undefined%
+ % format a number as two-digit hex
  \def\UTFviii@hexbyte#1{%
   \ifnum#1<16 0\fi%
   \UTFviii@hexnumber{#1}%
  }%
+
+ % override message to give the byte in hex
+ \def\UTFviii@invalid@err#1{%
+  \PackageError{inputenc}{Invalid UTF-8 byte "\UTFviii@hexbyte{`#1}}%
+   \UTFviii@invalid@help%
+ }%
 \fi%
 
 %: https://github.com/latex3/latex2e/pull/63
-% format a number as Unicode codepoint hex
 \ifx\UTFviii@hexcodepoint\@undefined%
+ % format a number as Unicode codepoint hex
  \def\UTFviii@hexcodepoint#1{%
   \ifnum#1<16 U+000%
   \else\ifnum#1<256 U+00%
@@ -44,6 +50,12 @@
   \fi\fi\fi\fi\fi%
   \UTFviii@hexnumber{#1}%
  }%
+
+ % override message to format the codepoint correctly
+ \gdef\UTFviii@splitcsname#1:#2\relax{%
+  #2 (\expandafter\UTFviii@hexcodepoint\expandafter{%
+   \the\numexpr\decode@UTFviii#2\relax})%
+ }%
 \fi%
 
 %: https://github.com/latex3/latex2e/pull/62
@@ -59,17 +71,3 @@
   \ifx\relax#2\relax\else\UTFviii@hexseq#2\relax\fi%
  }%
 \fi%
-
-%: https://github.com/latex3/latex2e/pull/62
-% override message to give the byte in hex
-\def\UTFviii@invalid@err#1{%
- \PackageError{inputenc}{Invalid UTF-8 byte "\UTFviii@hexbyte{`#1}}%
-  \UTFviii@invalid@help%
-}%
-
-%: https://github.com/latex3/latex2e/pull/63
-% override message to format the codepoint correctly
-\gdef\UTFviii@splitcsname#1:#2\relax{%
- #2 (\expandafter\UTFviii@hexcodepoint\expandafter{%
-  \the\numexpr\decode@UTFviii#2\relax})%
-}%
-- 
GitLab