gbranden pushed a commit to branch master
in repository groff.
commit 553591b31c2e1327dc163eae8559401ec603749b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 23 09:54:04 2026 -0600
src/roff/troff/env.cpp: Revise error diagnostic.
* src/roff/troff/env.cpp (environment_switch_request): Recast diagnostic
to make more conceptual sense; while "underflow" is a technically
correct description, the user is unlikely to know that GNU troff
stacks only environments that _aren't_ current; *roff documentation in
general suggests that only a simple stack data structure (or
equivalent) is used, without special storage for the current
environment "on deck"; and a forthcoming refactoring is going to make
that simpler arrangement effective in GNU troff regardless.
---
ChangeLog | 12 ++++++++++++
src/roff/troff/env.cpp | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index c379500c7..a63f16f7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-11-23 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (environment_switch_request): Recast
+ diagnostic to make more conceptual sense; while "underflow" is a
+ technically correct description, the user is unlikely to know
+ that GNU troff stacks only environments that _aren't_ current;
+ *roff documentation in general suggests that only a simple stack
+ data structure (or equivalent) is used, without special storage
+ for the current environment "on deck"; and a forthcoming
+ refactoring is going to make that simpler arrangement effective
+ in GNU troff regardless.
+
2026-11-23 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp: Trivially refactor.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 06935978a..de032231e 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3954,7 +3954,7 @@ static void environment_switch_request() // .ev
symbol nm = read_long_identifier();
if (nm.is_null()) {
if (env_stack == 0 /* nullptr */)
- error("environment stack underflow");
+ error("cannot pop the only environment in the stack");
else {
bool seen_space = curenv->seen_space;
bool seen_eol = curenv->seen_eol;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit