[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 08/08: src/roff/troff/div.cpp: Error on meaningless .ch.
From: |
G. Branden Robinson |
Subject: |
[groff] 08/08: src/roff/troff/div.cpp: Error on meaningless .ch. |
Date: |
Tue, 17 Nov 2020 10:09:47 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit e3b909eda11419daaf9e1ff028defc0e972ac827
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Nov 17 21:23:37 2020 +1100
src/roff/troff/div.cpp: Error on meaningless .ch.
* src/roff/troff/div.cpp (top_level_diversion::change_trap): Emit error
diagnostic if an attempt is made to move an unplanted macro. This
could have been a warning, as it's pretty harmless (though possibly a
big surprise to anyone who was wondering why their .ch was a no-op),
but there's no good warning category for this kind of problem and I am
not about to start a bike shed discussion about it right now.
---
ChangeLog | 10 ++++++++++
src/roff/troff/div.cpp | 3 ++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 4fa7960..3fd83cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-11-17 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * src/roff/troff/div.cpp (top_level_diversion::change_trap):
+ Emit error diagnostic if an attempt is made to move an unplanted
+ macro. This could have been a warning, as it's pretty harmless
+ {though possibly a big surprise to anyone who was wondering why
+ their .ch was a no-op}, but there's no good warning category for
+ this kind of problem and I am not about to start a bike shed
+ discussion about it right now.
+
2020-11-15 G. Branden Robinson <g.branden.robinson@gmail.com>
* doc/groff.texi: Update. Add introductory material. Rewrite
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 808ccbe..014d865 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -523,7 +523,7 @@ void top_level_diversion::remove_trap_at(vunits pos)
return;
}
}
-
+
void top_level_diversion::change_trap(symbol nam, vunits pos)
{
for (trap *p = page_trap_list; p; p = p->next)
@@ -531,6 +531,7 @@ void top_level_diversion::change_trap(symbol nam, vunits
pos)
p->position = pos;
return;
}
+ error("cannot move unplanted trap macro '%1'", nam.contents());
}
void top_level_diversion::print_traps()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 08/08: src/roff/troff/div.cpp: Error on meaningless .ch.,
G. Branden Robinson <=