[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: [pdfroff] Deduce "--no-toc-relocation" from input stream.
From: |
Keith Marshall |
Subject: |
[groff] 01/01: [pdfroff] Deduce "--no-toc-relocation" from input stream. |
Date: |
Mon, 13 Oct 2014 10:03:44 +0000 |
keithmarshall pushed a commit to branch master
in repository groff.
commit a3686e7724472436321b9c8b6018509c1eea3a90
Author: Keith Marshall <address@hidden>
Date: Mon Oct 13 11:02:31 2014 +0100
[pdfroff] Deduce "--no-toc-relocation" from input stream.
* pdfroff.sh (WRKFILE): Scan it for "pdfroff-option:set" records;
apply settings; check for equivalent of "--no-toc-relocation" option.
* spdf.tmac (TC): Emit "pdfroff-option:set toc-relocation=enabled".
---
contrib/pdfmark/ChangeLog | 9 +++++++++
contrib/pdfmark/pdfroff.sh | 19 +++++++++++++++++++
contrib/pdfmark/spdf.tmac | 1 +
3 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/contrib/pdfmark/ChangeLog b/contrib/pdfmark/ChangeLog
index 900fd5a..02719c5 100644
--- a/contrib/pdfmark/ChangeLog
+++ b/contrib/pdfmark/ChangeLog
@@ -1,3 +1,12 @@
+2014-10-13 Keith Marshall <address@hidden>
+
+ Deduce "--no-toc-relocation" from input stream.
+
+ * pdfroff.sh (WRKFILE): Scan it for "pdfroff-option:set" records;
+ apply settings; check for equivalent of "--no-toc-relocation" option.
+
+ * spdf.tmac (TC): Emit "pdfroff-option:set toc-relocation=enabled".
+
2014-10-12 Keith Marshall <address@hidden>
Avoid spurious user visible control messages on stderr.
diff --git a/contrib/pdfmark/pdfroff.sh b/contrib/pdfmark/pdfroff.sh
index c913193..1a0b7cb 100644
--- a/contrib/pdfmark/pdfroff.sh
+++ b/contrib/pdfmark/pdfroff.sh
@@ -588,6 +588,25 @@
#
echo ".pdfhref Z 0 0 0" >> $REFCOPY
#
+# Evaluate any processing options which may have been specified
+# as a result of parsing the document source ...
+#
+ eval `$SED -n '/^ *pdfroff-option:set */s//p' $WRKFILE`
+#
+# ... (which is currently supported to enable "toc-relocation",
+# only when the document actually relies on it, and if it is not
+# explicitly disabled from the command line) ...
+#
+ if test x${toc_relocation-"auto"} != xenabled
+ then
+#
+# ... thus we reproduce the effect of the "--no-toc-relocation"
+# option, when no enabling request is detected in the document
+# control stream.
+#
+ TC_DATA="" TOC_FORMAT="" BODY_FORMAT=""
+ fi
+#
# Re-enable progress reporting, if necessary ...
# (Missing 'awk' or 'diff' may have disabled it, to avoid display
# of spurious messages associated with reference resolution).
diff --git a/contrib/pdfmark/spdf.tmac b/contrib/pdfmark/spdf.tmac
index 42d75eb..d32bb74 100644
--- a/contrib/pdfmark/spdf.tmac
+++ b/contrib/pdfmark/spdf.tmac
@@ -198,6 +198,7 @@ The content for this section is not yet available.
.P1
.OP \n[PDF-TOC-ONLY]
address@hidden 1 i
+.if !dpdf:href.map .tm pdfroff-option:set toc_relocation=enabled
.if \\n[OPMODE] address@hidden
.PX \\$1
..
- [groff] 01/01: [pdfroff] Deduce "--no-toc-relocation" from input stream.,
Keith Marshall <=