[latex3-commits] [git/LaTeX3-latex3-latex3] master: Terminate expansion in \iow_wrap:nnnN correctly (fixes #491) (eff6093)
Joseph Wright
joseph.wright at morningstar2.co.uk
Fri Oct 19 22:12:11 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/eff60934d64012c6a12a2c7233b7978f7f17fed0
>---------------------------------------------------------------
commit eff60934d64012c6a12a2c7233b7978f7f17fed0
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Fri Oct 19 21:11:06 2018 +0100
Terminate expansion in \iow_wrap:nnnN correctly (fixes #491)
>---------------------------------------------------------------
eff60934d64012c6a12a2c7233b7978f7f17fed0
l3kernel/CHANGELOG.md | 4 ++
l3kernel/l3file.dtx | 8 +++-
l3kernel/testfiles/m3expl001.luatex.tlg | 1 +
l3kernel/testfiles/m3expl001.ptex.tlg | 1 +
l3kernel/testfiles/m3expl001.tlg | 1 +
l3kernel/testfiles/m3expl001.uptex.tlg | 1 +
l3kernel/testfiles/m3expl001.xetex.tlg | 1 +
l3kernel/testfiles/m3expl003.luatex.tlg | 1 +
l3kernel/testfiles/m3expl003.ptex.tlg | 1 +
l3kernel/testfiles/m3expl003.tlg | 1 +
l3kernel/testfiles/m3expl003.uptex.tlg | 1 +
l3kernel/testfiles/m3expl003.xetex.tlg | 1 +
l3kernel/testfiles/m3iow001.luatex.tlg | 14 ++++++
l3kernel/testfiles/m3iow001.lvt | 76 +++++++++++++++++++++++++++++++
l3kernel/testfiles/m3iow001.tlg | 14 ++++++
l3kernel/testfiles/m3iow001.uptex.tlg | 14 ++++++
l3kernel/testfiles/m3iow001.xetex.tlg | 14 ++++++
17 files changed, 152 insertions(+), 2 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 9bdbba0..6440c36 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Fixed
+
+- Wrapping of text in messages, etc., for some line lengths (fixes #491)
+
## [2018-10-17]
### Added
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 3ffb068..0e4ac28 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -1608,6 +1608,7 @@
% {
% \@@_wrap_line_loop:w,
% \@@_wrap_line_aux:Nw,
+% \@@_wrap_line_seven:nnnnnnn,
% \@@_wrap_line_end:NnnnnnnnN,
% \@@_wrap_line_end:nw,
% \@@_wrap_end_chunk:w
@@ -1632,7 +1633,9 @@
% |#2|--|#9| of the \texttt{line_loop} auxiliary or as one of the
% arguments |#2|--|#8| of the \texttt{line_end} auxiliary. In both
% cases stop the assignment and work out how many characters are still
-% needed. The weird \cs{use_none:nnnnn} ensures that the required
+% needed. Notice that when we have exactly seven arguments to clean up,
+% a \cs{exp_stop_f:} has to be inserted to stop the \cs{exp:w}.
+% The weird \cs{use_none:nnnnn} ensures that the required
% data is in the right place.
% \begin{macrocode}
\cs_new_protected:Npn \@@_wrap_line:nw #1
@@ -1666,10 +1669,11 @@
\or: \use_none:nnnn
\or: \use_none:nnnnn
\or: \use_none:nnnnnn
- \or: \use_none:nnnnnnn
+ \or: \@@_wrap_line_seven:nnnnnnn
\fi:
{ } { } { } { } { } { } { } #3
}
+\cs_new:Npn \@@_wrap_line_seven:nnnnnnn #1#2#3#4#5#6#7 { \exp_stop_f: }
\cs_new:Npn \@@_wrap_line_end:NnnnnnnnN #1#2#3#4#5#6#7#8#9
{
#2 #3 #4 #5 #6 #7 #8
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 7deb4ad..60ca59a 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2836,6 +2836,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index a30db7b..14d0648 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index f52a2a8..d416b7b 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 4406589..55acef8 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 047af7c..08c102c 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2874,6 +2874,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 7deb4ad..60ca59a 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2836,6 +2836,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index a30db7b..14d0648 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index f52a2a8..d416b7b 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 4406589..55acef8 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3129,6 +3129,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 047af7c..08c102c 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2874,6 +2874,7 @@ Defining \__iow_wrap_next:nw on line ...
Defining \__iow_wrap_line:nw on line ...
Defining \__iow_wrap_line_loop:w on line ...
Defining \__iow_wrap_line_aux:Nw on line ...
+Defining \__iow_wrap_line_seven:nnnnnnn on line ...
Defining \__iow_wrap_line_end:NnnnnnnnN on line ...
Defining \__iow_wrap_line_end:nw on line ...
Defining \__iow_wrap_end_chunk:w on line ...
diff --git a/l3kernel/testfiles/m3iow001.luatex.tlg b/l3kernel/testfiles/m3iow001.luatex.tlg
index d44d793..b01fbd2 100644
--- a/l3kernel/testfiles/m3iow001.luatex.tlg
+++ b/l3kernel/testfiles/m3iow001.luatex.tlg
@@ -67,3 +67,17 @@ TEST 9: Close iow
test
)
============================================================
+============================================================
+TEST 10: Wrapping text
+============================================================
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhii
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiij
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijj
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkl
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkll
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllm
+abcdefghijklmnopqrstuvwxyzABCDE
+AABBCCDDEEFFGGHHIIJJKKLFGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllmm
+============================================================
diff --git a/l3kernel/testfiles/m3iow001.lvt b/l3kernel/testfiles/m3iow001.lvt
index eea9ac8..e55768b 100644
--- a/l3kernel/testfiles/m3iow001.lvt
+++ b/l3kernel/testfiles/m3iow001.lvt
@@ -96,4 +96,80 @@
\file_input:n { testwrite.log }
}
+\TEST { Wrapping~text }
+ {
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhii
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiij
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijj
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjk
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkk
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkl
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkll
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllm
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ \iow_wrap:nnnN
+ {
+ abcdefghijklmnopqrstuvwxyzABCDE~
+ FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllmm
+ }
+ { AABBCCDDEEFFGGHHIIJJKKL }
+ { }
+ \iow_term:n
+ }
+
\END
diff --git a/l3kernel/testfiles/m3iow001.tlg b/l3kernel/testfiles/m3iow001.tlg
index a58469d..ac275f1 100644
--- a/l3kernel/testfiles/m3iow001.tlg
+++ b/l3kernel/testfiles/m3iow001.tlg
@@ -67,3 +67,17 @@ TEST 9: Close iow
test
)
============================================================
+============================================================
+TEST 10: Wrapping text
+============================================================
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhii
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiij
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijj
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkl
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkll
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllm
+abcdefghijklmnopqrstuvwxyzABCDE
+AABBCCDDEEFFGGHHIIJJKKLFGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllmm
+============================================================
diff --git a/l3kernel/testfiles/m3iow001.uptex.tlg b/l3kernel/testfiles/m3iow001.uptex.tlg
index ffe31d8..e5dff00 100644
--- a/l3kernel/testfiles/m3iow001.uptex.tlg
+++ b/l3kernel/testfiles/m3iow001.uptex.tlg
@@ -67,3 +67,17 @@ TEST 9: Close iow
test
)
============================================================
+============================================================
+TEST 10: Wrapping text
+============================================================
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhii
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiij
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijj
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkl
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkll
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllm
+abcdefghijklmnopqrstuvwxyzABCDE
+AABBCCDDEEFFGGHHIIJJKKLFGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllmm
+============================================================
diff --git a/l3kernel/testfiles/m3iow001.xetex.tlg b/l3kernel/testfiles/m3iow001.xetex.tlg
index 510ea88..5c56d03 100644
--- a/l3kernel/testfiles/m3iow001.xetex.tlg
+++ b/l3kernel/testfiles/m3iow001.xetex.tlg
@@ -67,3 +67,17 @@ TEST 9: Close iow
test
)
============================================================
+============================================================
+TEST 10: Wrapping text
+============================================================
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhii
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiij
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijj
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkk
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkl
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkll
+abcdefghijklmnopqrstuvwxyzABCDE FGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllm
+abcdefghijklmnopqrstuvwxyzABCDE
+AABBCCDDEEFFGGHHIIJJKKLFGHJIKLMNOPQRZTUVWXYZaabbccddeeffgghhiijjkkllmm
+============================================================
More information about the latex3-commits
mailing list