[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proposed: treat color, cp, linetabs, vpt request arguments as *roff Bool
From: |
G. Branden Robinson |
Subject: |
Proposed: treat color, cp, linetabs, vpt request arguments as *roff Booleans |
Date: |
Sun, 4 Feb 2024 00:47:35 -0600 |
Hi all,
I have another language change proposal. I suspect impact will be low,
but it is strictly speaking a behavior change.
o The `color`, `cp`, `linetabs`, and `vpt` requests now interpret
arguments with negative values as instructions to disable the
corresponding feature, using the *roff integer-to-Boolean conversion
idiom instead of the C/C++ one. Thus, if you invoke these requests
with a register interpolation, the outcome agrees with an `if` test of
the register's value.
Here is a motivating example.
.nr i-want-compatibility-mode -1
.if \n[i-want-compatibility-mode] .tm I want compatibility mode!
.cp \n[i-want-compatibility-mode]
.ie \n(.C .tm I'm in compatibility mode now.
.el .tm I am NOT in compatibility mode.
groff 1.22.4, 1.23.0, and Git HEAD:
I'm in compatibility mode now.
groff with this patch:
I am NOT in compatibility mode.
Patch attached.
Regards,
Branden
bool.diff
Description: Text Data
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Proposed: treat color, cp, linetabs, vpt request arguments as *roff Booleans,
G. Branden Robinson <=