gbranden pushed a commit to branch master
in repository groff.
commit b6a369d79efba548a7a824146b08105bd5a476a1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jul 10 03:28:51 2026 -0500
tmac/s.tmac: Fix code style nit.
* tmac/s.tmac (TC): De-pessimize by handling multiple numerical
expression evaluations together with the `&` logical "and" operator to
connect them. `.if ... .if` is a legitimate pattern, but only
necessary when different kinds of expressions need to be evaluated; in
*roff the three kinds are numeric expressions, output comparison
expressions, and the somewhat vaguely named "conditional expressions"
(`.if d mac`, `.if t`, and so forth). This way we avoid a trip
through the parser's main loop.
Also unindent body of control line, consistently with the rest of the
macro definition and the rest of this file. It appears to have been
Clark's style. (I would indent _all_ control lines of a macro
definition, personally...)
---
ChangeLog | 12 ++++++++++++
tmac/s.tmac | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index a671e8cf1..189d5e602 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-07-10 G. Branden Robinson <[email protected]>
+
+ * tmac/s.tmac (TC): Fix code style nit. De-pessimize by
+ handling multiple numerical expression evaluations together with
+ the `&` logical "and" operator to connect them. `.if ... .if`
+ is a legitimate pattern, but only necessary when different kinds
+ of expressions need to be evaluated; in *roff the three kinds
+ are numeric expressions, output comparison expressions, and the
+ somewhat vaguely named "conditional expressions" (`.if d mac`,
+ `.if t`, and so forth). This way we avoid a trip through the
+ parser's main loop.
+
2026-07-10 G. Branden Robinson <[email protected]>
* tmac/s.tmac: Trivially refactor. Rename `gottitle*pdf`
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 5a1476691..0cedf239d 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2061,7 +2061,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
..
.\" print the table of contents on page i
.de TC
-. if \\n[PDFFEAT]=1 .if \\n[cov*got-title] .pdfswitchtopage after title
+.if (\\n[PDFFEAT]=1 & \\n[cov*got-title]) .pdfswitchtopage after title
.P1
.pg@begin 1 i
.PX \\$1
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit