[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #53196] .hy values 4 and 8 ignored for some words

From: Dave
Subject: [bug #53196] .hy values 4 and 8 ignored for some words
Date: Tue, 20 Feb 2018 23:55:58 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0


                 Summary: .hy values 4 and 8 ignored for some words
                 Project: GNU troff
            Submitted by: barx
            Submitted on: Tue 20 Feb 2018 10:55:57 PM CST
                Category: None
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None



For some words, groff ignores .hy settings 4 ("Do not hyphenate the last two
characters of a word") and 8 ("Do not hyphenate the first two characters of a
word").  This bug occurs in at least versions 1.22.2 and 1.22.3 of groff.

This example, which can be pasted directly into the shell, illustrates the bug
with with ".hy 8" set:

groff -a << EOF
.ll 1i \" short enough to break the third word on each line
Visit yonder arboretum.
Visit yonder archipelago.
.hy 8 \"should prevent breaking after only two characters
Visit yonder arboretum.
Visit yonder archipelago.

The output is:

<beginning of page>
Visit yonder ar<hy>
Visit yonder ar<hy>
Visit yonder
Visit yonder ar<hy>

That is, groff follows the ".hy 8" setting for the word "arboretum" (carrying
the whole word to the next line rather than breaking it) but not for

The bug seems to be triggered when the hyphenation for the word is explicitly
provided (either by the system, in groff's hyphenation exception file, or by
the user, via the .hw request) rather than inferred from a hyphenation
pattern.  To verify that the exception file contains "archipelago" but not

egrep `echo 'arboretum|archipelago' | sed 's/./&-?/g'`

The user should not have to know or care whether groff hyphenates a word using
a pattern or an exception-file entry; groff should follow the restrictions
specified in .hy regardless.

Additionally, a user asking groff not to split words by leaving only two
characters on a line might reasonably expect this to include words already
containing hyphens. However, groff does not honor this restriction, either:

groff -a << EOF
.\" don't hyphenate the first and last two characters of a word
.hy 12
.ll 1i
He's been my go-to guy for math questions.

[Bug history: this problem was originally reported in bug #42503.  However,
that bug's description was unclear and the title was misleading, and this bug
tracker seems to lack the ability to update a bug's title.  So this current
bug report is hopefully clearer.]


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]