[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 25/35: [troff]: Throw warning when ignoring font change.
From: |
G. Branden Robinson |
Subject: |
[groff] 25/35: [troff]: Throw warning when ignoring font change. |
Date: |
Tue, 21 Jun 2022 14:26:30 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 0effe118480aac910c2826b11ec33f0566532a4d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Jun 20 17:31:35 2022 -0500
[troff]: Throw warning when ignoring font change.
[troff]: Throw warning in font category when a font selection escape
sequence is used after the output line continuation escape sequence on
an input line, because it is ignored.
* src/roff/troff/env.cpp (environment::set_font): Do it.
* doc/groff.texi (Warnings):
* src/roff/troff/troff.1.man (Warnings): Document it.
---
ChangeLog | 11 +++++++++++
doc/groff.texi | 5 ++++-
src/roff/troff/env.cpp | 4 +++-
src/roff/troff/troff.1.man | 5 ++++-
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b11b7c0e..88b5f74c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-06-20 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [troff]: Throw warning in font category when a font selection
+ escape sequence is used after the output line continuation
+ escape sequence on an input line, because it is ignored.
+
+ * src/roff/troff/env.cpp (environment::set_font): Do it.
+
+ * doc/groff.texi (Warnings):
+ * src/roff/troff/troff.1.man (Warnings): Document it.
+
2022-06-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/env.cpp (font_change): Boolify.
diff --git a/doc/groff.texi b/doc/groff.texi
index dedc5d8c..0507d65e 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -16366,7 +16366,10 @@ occurs in compatibility mode.
@item font
@itemx 131072
-A non-existent font was selected. This category is enabled by default.
+A non-existent font was selected, or the selection was ignored because a
+font selection escape sequence was used after the output line
+continuation escape sequence on an input line. This category is enabled
+by default.
@item ig
@itemx 262144
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 5a6f85d1..a56f07b3 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -498,8 +498,10 @@ static node *do_underline_special(bool do_underline_spaces)
bool environment::set_font(symbol nm)
{
- if (interrupted)
+ if (interrupted) {
+ warning(WARN_FONT, "ignoring font selection on interrupted line");
return true; // "no operation" is successful
+ }
if (nm == symbol("P") || nm.is_empty()) {
if (family->make_definite(prev_fontno) < 0)
return false;
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index 042e56a2..f2830ac5 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -579,7 +579,10 @@ This category is enabled by default.
.
.TP
.BR font "\t131072"
-A non-existent font was selected.
+A non-existent font was selected,
+or the selection was ignored because a font selection escape sequence
+was used after the output line continuation escape sequence on an input
+line.
.
This category is enabled by default.
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 25/35: [troff]: Throw warning when ignoring font change.,
G. Branden Robinson <=