[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #66054] [troff] permit special characters as source hyphenation cod
From: |
G. Branden Robinson |
Subject: |
[bug #66054] [troff] permit special characters as source hyphenation codes |
Date: |
Thu, 8 Aug 2024 08:07:29 -0400 (EDT) |
Follow-up Comment #4, bug #66054 (group groff):
[comment #3 comment #3:]
> [comment #2 comment #2:]
> > 2. `.hcode \['a] \['a]` should have altered `\['a]`'s hyphenation code.
>
> I might be misunderstanding the semantics of assigning a character's hcode
to itself. I understood it to mean "make this character eligible for
hyphenation (if it wasn't already)."
Basically, yes. There's a subtlety: you might do this to move a letter from
an equivalence class with another letter to its own equivalence class.
For example, by default, the formatter internally does the following.
.hcode B b
Observe.
$ printf '.ll 1n\nABBOT\n.pl \\n(nlu\n' | nroff -Wbreak
AB‐
BOT
$ printf '.hcode B B\n.ll 1n\nABBOT\n.pl \\n(nlu\n' | nroff -Wbreak
ABBOT
> The actual code assigned, as you've pointed out, is (or can be) arbitrary.
It can be any value from 1..255.
> So in the case above, \['a] already had an hcode. (Granted, it _shouldn't_
have, due to problem 1, but that's already been identified as a separate
problem.) Thus, ".hcode \['a] \['a]" is effectively a no-op.
It wouldn't necessarily be if we had a larger pool of hyphenation code values
to draw from. But we're limited to fewer than 255 in practice, because it's
hard/impossible to use any of the C0 or C1 controls, or the space, as
hyphenation code values.
> Maybe the root problem is that ".hcode a b" and ".hcode a a" use the same
syntax but do distinctly different things. It obscures to humans writing roff
code what they're really asking for.
I won't say this critique is invalid, but it's not something I have a
hankering to overturn for _groff_ 1.24.
I'm also not sure I agree. I think the semantics can be defended if one
understands what an "equivalence class" is. Doesn't *everyone* take a
university course in discrete mathematics? ;-)
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?66054>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/01
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/01
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/04
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/07
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/07
- [bug #66054] [troff] permit special characters as source hyphenation codes,
G. Branden Robinson <=
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/09
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/09
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, G. Branden Robinson, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/10
- [bug #66054] [troff] permit special characters as source hyphenation codes, Dave, 2024/08/10