[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 06/09: [tbl] Save and restore tab stops.
From: |
G. Branden Robinson |
Subject: |
[groff] 06/09: [tbl] Save and restore tab stops. |
Date: |
Wed, 21 Oct 2020 02:44:45 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit d0e03cf610aa4e7bb9a549535bcce8ba5f8b9435
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Oct 20 23:39:06 2020 +1100
[tbl] Save and restore tab stops.
* src/preproc/tbl/table.cpp (table::init_output): Save the value of
\n[.tabs] when starting a table. In the reset macro, restore the
saved value.
Based on a patch by Bjarni Ingi Gislason (tweaked to use a more
normative preprocessor symbol; "REG"s aren't "NAME"s).
Fixes <https://savannah.gnu.org/bugs/index.php?42978>.
---
ChangeLog | 14 ++++++++++++++
src/preproc/tbl/table.cpp | 3 +++
2 files changed, 17 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 1a86a6e..ce0b7ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2020-10-20 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * src/preproc/tbl/table.cpp (table::init_output): Save the value
+ of \n[.tabs] when starting a table. In the reset macro, restore
+ the saved value.
+
+ Based on a patch by Bjarni Ingi Gislason (tweaked to use a more
+ normative preprocessor symbol; "REG"s aren't "NAME"s).
+
+ * src/preproc/tbl/tests/save-and-restore-tab-stops.sh: Test it.
+ * src/preproc/tbl/tbl.am (tbl_TESTS): Run test.
+
+ Fixes <https://savannah.gnu.org/bugs/index.php?42978>.
+
+2020-10-20 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* src/roff/nroff/nroff.sh: Recognize -E option and pass it
through to troff. Document it in usage message.
* src/roff/nroff/nroff.1.man: Document new -E option.
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index dd8fcac..8dbd4bc 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -48,6 +48,7 @@ const int DEFAULT_COLUMN_SEPARATION = 3;
#define SAVED_FILL_REG PREFIX "fll"
#define SAVED_INDENT_REG PREFIX "ind"
#define SAVED_CENTER_REG PREFIX "cent"
+#define SAVED_TABS_NAME PREFIX "tabs"
#define TABLE_DIVERSION_NAME PREFIX "table"
#define TABLE_DIVERSION_FLAG_REG PREFIX "tflag"
#define TABLE_KEEP_MACRO_NAME PREFIX "tkeep"
@@ -1774,11 +1775,13 @@ void table::init_output()
".ie \\n[.u] .fi\n"
".el .nf\n"
".ce \\n[.ce]\n"
+ ".ta \\\\*[" SAVED_TABS_NAME "]\n"
"..\n"
".nr " SAVED_INDENT_REG " \\n[.i]\n"
".nr " SAVED_FONT_REG " \\n[.f]\n"
".nr " SAVED_SIZE_REG " \\n[.s]\n"
".nr " SAVED_FILL_REG " \\n[.u]\n"
+ ".ds " SAVED_TABS_NAME " \\n[.tabs]\n"
".nr T. 0\n"
".nr " CURRENT_ROW_REG " 0-1\n"
".nr " LAST_PASSED_ROW_REG " 0-1\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 06/09: [tbl] Save and restore tab stops.,
G. Branden Robinson <=