[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff/contrib/pdfmark ChangeLog pdfmark.tmac
From: |
Keith Marshall |
Subject: |
[Groff-commit] groff/contrib/pdfmark ChangeLog pdfmark.tmac |
Date: |
Wed, 11 Apr 2007 22:45:11 +0000 |
CVSROOT: /cvsroot/groff
Module name: groff
Changes by: Keith Marshall <keithmarshall> 07/04/11 22:45:11
Modified files:
contrib/pdfmark: ChangeLog pdfmark.tmac
Log message:
Avoid stray newlines in folded pdfmark literal content.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/pdfmark/ChangeLog?cvsroot=groff&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/groff/contrib/pdfmark/pdfmark.tmac?cvsroot=groff&r1=1.7&r2=1.8
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/contrib/pdfmark/ChangeLog,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- ChangeLog 11 Apr 2007 22:23:48 -0000 1.21
+++ ChangeLog 11 Apr 2007 22:45:11 -0000 1.22
@@ -1,5 +1,16 @@
2007-04-11 Keith Marshall <address@hidden>
+ Avoid stray newlines in folded pdfmark literal content.
+
+ * pdfmark.tmac (pdf*pdfmark.dispatch.wrapped): New string; define it
+ when accumulating long literal content; make it undefined otherwise.
+ (PDFMARK.FOLDWIDTH, PDFMARK.FOLDWIDTH.MAX): Reserve space for two
+ extra characters, to accommodate a space and an escaped newline,
+ while accumulating literal content, in case folding is required.
+ (pdf*pdfmark.dispatch) [pdf*pdfmark.dispatch.wrapped]: Add them.
+
+2007-04-11 Keith Marshall <address@hidden>
+
* pdfmark.tmac (pdfbookmark): Don't evaluate within diversions; defer
placement until diversion is copied out at top level.
Index: pdfmark.tmac
===================================================================
RCS file: /cvsroot/groff/groff/contrib/pdfmark/pdfmark.tmac,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- pdfmark.tmac 11 Apr 2007 22:23:48 -0000 1.7
+++ pdfmark.tmac 11 Apr 2007 22:45:11 -0000 1.8
@@ -286,20 +286,23 @@
.\" allowed literal token length.
.\"
.length pdf:length "\\*[pdf:composed.literal] \\$*\"
-.ie (\\n[pdf:length] > \\n[PDFMARK.FOLDWIDTH]) \{\
+.ie (\\n[pdf:length] > (\\n[PDFMARK.FOLDWIDTH] - 2)) \{\
.\"
.\" If it has grown too long, then it must be folded across two
.\" physical PDFMARK output records, so check if we can accommodate
.\" the portion collected so far within the current output record.
.\"
. pdf*length.increment "\\*[pdf:composed.literal]\"
-. if (\\n[pdf:length] > \\n[PDFMARK.FOLDWIDTH.MAX]) \{\
+. if (\\n[pdf:length] > (\\n[PDFMARK.FOLDWIDTH.MAX] - 2)) \{\
. \"
. \" The current output record CAN'T accommodate the currently
. \" composed portion of the literal, so flush out the current
-. \" record, to make way for the accumulated literal.
+. \" record, to make way for the accumulated literal, and mark
+. \" the dispatch mode as "wrapped", for the fragments of the
+. \" folded literal string, which are to follow.
. \"
. pdf*pdfmark.dispatch
+. ds pdf*pdfmark.dispatch.wrapped
. \}
. ie d pdf:composed.line \{\
. \"
@@ -381,10 +384,12 @@
. \}
. \}
.\"
-.\" Finally, since we have completed the accumulation of the literal,
-.\" we revert to the normal "pdf*compose" action, for collection of
-.\" the next token (if any).
+.\" Finally, since we have completed the accumulation of the literal, we
+.\" revert to the "unwrapped" mode of operation for "pdf*pdfmark.dispatch",
+.\" and restore the normal "pdf*compose" action, for collection of the next
+.\" token (if any).
.\"
+. rm pdf*pdfmark.dispatch.wrapped
. als pdf*compose pdf*compose.next
. \}
..
@@ -406,6 +411,15 @@
.\" before attempting to post it; it then cleans up after posting, to
.\" ensure that each collected record is posted only once.
.\"
+. if d pdf*pdfmark.dispatch.wrapped \{\
+. \"
+. \" When dispatching an excessively long literal string, which
+. \" must be wrapped over multiple records, this mode is active
+. \" for all but the closing record; we must escape the newline
+. \" at the end of each such unclosed literal record.
+. \"
+. as pdf:composed.line " \\\\\\\\\"
+. \}
. pdf*pdfmark.post
. rm pdf:composed.line
. \}