Follow-up Comment #1, bug #67310 (group groff):

Here's an even simpler example.


$ cat EXPERIMENTS/hyphenation-barrier.roff
.ll 12n
.hy 14
footnote
.hy 0
foobar\c
.hy 14
footnote
$ groff -a EXPERIMENTS/hyphenation-barrier.roff
<beginning of page>
footnote foo<hy>
barfootnote


"foobar" hyphenates despite--one supposes--the hyphenation mode being zero
while the word is set.

Watch what happens when we prefix "foobar" with a hyphenation control escape
sequence.


$ diff -u EXPERIMENTS/hyphenation-barrier{,2}.roff
--- EXPERIMENTS/hyphenation-barrier.roff        2025-07-17 14:38:45.522809601
-0500
+++ EXPERIMENTS/hyphenation-barrier2.roff       2025-07-17 14:38:59.394926960
-0500
@@ -2,6 +2,6 @@
 .hy 14
 footnote
 .hy 0
-foobar\c
+\%foobar\c
 .hy 14
 footnote
$ groff -a EXPERIMENTS/hyphenation-barrier2.roff 
<beginning of page>
troff:EXPERIMENTS/hyphenation-barrier2.roff:7: warning [p 1, 0.0i]: cannot
adjust line
footnote
foobarfootnote

 
Works fine.  Why?  We can use the forthcoming _groff_ 1.24.0 release's new
`pline` request to throw light on the matter.

As noted in comment #0, nodes make the difference.


$ diff -u EXPERIMENTS/hyphenation-barrier{,3}.roff
--- EXPERIMENTS/hyphenation-barrier.roff        2025-07-17 14:38:45.522809601
-0500
+++ EXPERIMENTS/hyphenation-barrier3.roff       2025-07-17 14:41:30.003979268
-0500
@@ -3,5 +3,6 @@
 footnote
 .hy 0
 foobar\c
+.pline
 .hy 14
 footnote
$ ./build/test-groff -a EXPERIMENTS/hyphenation-barrier3.roff 
<beginning of page>
[{"type": "line_start_node", "diversion level": 0, "is_special_node": false},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "f"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "t"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "n"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "t"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "e"},
{"type": "word_space_node", "diversion level": 0, "is_special_node": false,
"hunits": 2500, "undiscardable": false, "is hyphenless breakpoint": false,
"terminal_color": "default", "width_list": [{ "width": 2500, "sentence_width":
2500 }], "unformat": false},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "f"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "b"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "a"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "r"},
{"type": "transparent_dummy_node", "diversion level": 0, "is_special_node":
false}]
footnote foo<hy>
barfootnote
$ diff -u EXPERIMENTS/hyphenation-barrier{3,4}.roff
--- EXPERIMENTS/hyphenation-barrier3.roff       2025-07-17 14:41:30.003979268
-0500
+++ EXPERIMENTS/hyphenation-barrier4.roff       2025-07-17 14:42:43.196364801
-0500
@@ -2,7 +2,7 @@
 .hy 14
 footnote
 .hy 0
-foobar\c
+\%foobar\c
 .pline
 .hy 14
 footnote
$ ./build/test-groff -a EXPERIMENTS/hyphenation-barrier4.roff 
<beginning of page>
[{"type": "line_start_node", "diversion level": 0, "is_special_node": false},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "f"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "t"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "n"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "t"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "e"},
{"type": "word_space_node", "diversion level": 0, "is_special_node": false,
"hunits": 2500, "undiscardable": false, "is hyphenless breakpoint": false,
"terminal_color": "default", "width_list": [{ "width": 2500, "sentence_width":
2500 }], "unformat": false},
{"type": "hyphen_inhibitor_node", "diversion level": 0, "is_special_node":
false},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "f"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "o"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "b"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "a"},
{"type": "glyph_node", "diversion level": 0, "is_special_node": false,
"character": "r"},
{"type": "transparent_dummy_node", "diversion level": 0, "is_special_node":
false}]
troff:EXPERIMENTS/hyphenation-barrier4.roff:8: warning [page 1, 0.0i]: cannot
adjust line; underset by 0.370417i
footnote
foobarfootnote


The telling detail is the following line, unique to the output of
"hyphenation-barrier4.roff".


{"type": "hyphen_inhibitor_node", "diversion level": 0, "is_special_node":
false},




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67310>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to