Re: How and when to control hyphenation (was: [PATCH 05/10] fsconfig.2: document 'new' mount api)
From: G. Branden Robinson <hidden>
Date: 2025-08-06 14:01:29
Subsystem:
the rest · Maintainer:
Linus Torvalds
Hi Alex, At 2025-08-06T13:45:46+0200, Alejandro Colomar wrote:
quoted
quoted
Is there any way of knowing how long an identifier can be before it's necessary to \%-ify it?TL;DR: five letters.[1]
[...]
quoted
Example: $ hyphen FSCONFIG_SET_PATH_EMPTY FS‐CON‐FIG_SET_PATH_EMPTYWhile I see the usefulness, I'd find it cumbersome having to ask it about every identifier I'll be using.
I find myself having to ask relatively seldom. Most of us can subitize
a word such that we discern whether its more than five letters. And
erring by prefixing an (automatically) unhyphenable word of any length
does no harm to document correctness or rendering.
A more likely source of error is forgetting what *roff considers a word.
Here's an example that's bitten me.
[snip]
commit 2c5853ec5afbc4d58c320457083aa6eaa9d046e9
Author: G. Branden Robinson [off-list ref]
Date: Sat Jun 8 04:08:55 2024 -0500
man/curs_inopts.3x: Fix markup error.
Use of `\%` as a hyphenation suppressor _must_ come at the beginning of
a word.
diff --git a/man/curs_inopts.3x b/man/curs_inopts.3x
index b69165d39..77b1777f4 100644
--- a/man/curs_inopts.3x
+++ b/man/curs_inopts.3x@@ -562,9 +562,9 @@ .SH NOTES (\*(``cooked\*('') mode from raw and cbreak modes, respectively. Mixing -.BR raw / \%noraw +.BR \%raw / noraw calls with -.BR cbreak / \%nocbreak +.BR \%cbreak / nocbreak calls leads to terminal driver control states that are hard to predict or understand; doing so is not recommended.
[end snip] McIlroy's original man(7) implementation could have been more helpful in marking code literals. On the other hand, linkers of the day tended to restrict your externally visible symbols to six characters at most. If I went to the Temple of Unix at Murray Hill, New Jersey to petition the giant enthroned statue of Ken Thompson for divine aid, a booming voice would laugh and mock the folly of mortals in selecting identifier names that were longer than five characters in the first place. That's enough for `creat`, `vflag`, and `swtch`...what more do you need? :-|
I personally never use it, unless I read the page and find some line break ugly. And *never* use it in manual page references (BR), with the rationale being that we'll eventually replace them with MR, which does that for us.
I haven't forgotten about my series of sed scripts to rewrite (mainly) syscalls(2).
grotty:<standard input>:(<standard input>):9: warning: unrecognized X command 'sgr 0' ignored grotty:<standard input>:(<standard input>):9: warning: unrecognized X command 'sgr 0' ignored (BTW, Branden, why am I seeing those error messages recently?)
Did you change distributions recently? The messages are an artifact of a downstream patch to groff to force Teletype-style overstriking. Over the past two years, distributors that had it in have been taking it out. https://git.alpinelinux.org/aports/commit/?id=d6fe59c946066adef3e19e75f1e7caffda5a4cd1 https://gitlab.archlinux.org/archlinux/packaging/packages/groff/-/commit/025a63b7e55a24c0a1892045819eef79fdc67873 https://metadata.ftp-master.debian.org/changelogs//main/g/groff/groff_1.23.0-9_changelog * Adopt upstream's use of SGR escape sequences for man/mdoc (LP: #610609). I turned these off for Debian in 2002 because pagers didn't cope well at the time, but it's now 21 years later and things have changed; SGR escape sequences resolve some ambiguity (see #963490) and are required for new features such as clickable hyperlinks. Regards, Branden
Attachments
- signature.asc [application/pgp-signature] 833 bytes