gbranden pushed a commit to branch master
in repository groff.
commit b09c509cba6450f630e6098b25f4106f45e19f59
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jul 17 11:47:33 2026 -0500
[doc,man]: Clarify serial use of control requests.
---
doc/groff.texi.in | 23 ++++++++++++++++++++---
man/groff.7.man | 20 ++++++++++++++++++++
2 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 25e7d463b..00c3fc770 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -7798,9 +7798,26 @@ others false.
@ifinfo
@opindex @r{<colon>}
@end ifinfo
-We can operate on truth values with the logical operators @code{&}
-(logical conjunction or ``and'') and @code{:} (logical disjunction or
-``or''). They evaluate as comparison operators do.
+We can operate on truth values with the logical operators
+@code{&}
+(logical conjunction or ``and'')
+and
+@code{:}
+(logical disjunction or ``or'').
+They evaluate as comparison operators do.
+
+@strong{Caution:@:}
+Logical operators do not ``short-circuit'' in
+@code{roff}
+as they do in languages like C.
+If you want,
+for instance,
+to test the value of one register
+@emph{only}
+if another has a true value,
+you can use serial
+@code{if}
+requests.@footnote{@xref{Conditionals and Loops}.}
@opindex !
@cindex complementation, logical
diff --git a/man/groff.7.man b/man/groff.7.man
index 6c71ce4d9..ae2a860b5 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -1365,6 +1365,26 @@ and
.
They evaluate as comparison operators do.
.
+.
+.P
+.I Caution:
+Logical operators do not \[lq]short-circuit\[rq] in
+.I roff
+as they do in languages like C.
+.
+If you want,
+for instance,
+to test the value of one register
+.I only
+if another has a true value,
+you can use serial
+.RB \[lq] if\^ \[rq]
+requests.
+.
+See section \[lq]Control structures\[rq] below.
+.
+.
+.P
A logical complementation (\[lq]not\[rq]) operator,
.B !\&,
works only within
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit