URL:
  <https://savannah.gnu.org/bugs/?67347>

                 Summary: [troff] want new `\p`-like escape sequences for
end-of-sentence and non-adjustment
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Tue 22 Jul 2025 05:02:34 PM GMT
                Category: Core
                Severity: 1 - Wish
              Item Group: Feature change
                  Status: Postponed
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 22 Jul 2025 05:02:34 PM GMT By: G. Branden Robinson <gbranden>
I think we need a new escape sequence to resolve bug #60571.

That would be, say, `\T`, which would turn on a sticky end-of-sentence status
that cannot be undone until the next word break (at which time the
end-of-sentence status is honored, and additional inter-sentence-spacing is
applied if configured).  I know of no workaround for the problem of footnote
marks (or other text trailing end-of-sentence punctuation) negating the
end-of-sentence status of a word.

Similarly, sometimes when you're formatting technical text in an environment
with adjustment enabled, the output line just won't coƶperate, but you don't
want a warning about an underset line.  This problem **can** be worked around
by temporarily suspending adjustment or fiddling the warning mask, but an
escape sequence seems more targeted and elegant to me because it's something
that usefully applies to just one word, like a URL.  I propose the escape
sequence `\P` for this purpose, because it's so similar to `\p` for "break and
spread"; `\P` would mean "don't spread if breaking".

Here's a concrete example from our own docs.

_groff_font_(5):

.br
.ne 4v \" Keep next paragraph together with (possibly 2-line) synopsis.
.P
The form of the
.I metrics
field is as follows
(on one line;
it may be broken here for readability).
.
.
.IP
.\" XXX: Turning off adjustment is ugly; thanks to meter-long specimens
.\" like this, we need an escape sequence that selectively disables
.\" adjustment at the end of a word.
.na
.I width\/\c
.RI [\fB,\fP[ \:height\/\c
.RI [\fB,\fP[ \:depth\/\c
.RI [\fB,\fP[ \:\%italic-correction\/\c
.RI [\fB,\fP[ \:\%left-italic-correction\/\c
.RI [\fB,\fP[ \:\%subscript-correction ]]]]]]]]]]
.ad \*[AD]


I envision these escape sequences working similarly to `\p`: they can appear
anywhere within a word, but their effect occurs only at the **end** of that
word.

The new escape sequence for overriding non-end-of-sentence characters can be
further mooted in bug #60571.  I wanted to raise both here because I expect
that, if implemented, they will involve neighboring or identical parts of the
code base.

Postponing for consideration after the _groff_ 1.24.0 release.







    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to