groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff ChangeLog doc/groff.texinfo


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog doc/groff.texinfo
Date: Sat, 01 May 2010 05:41:20 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     10/05/01 05:41:20

Modified files:
        .              : ChangeLog 
        doc            : groff.texinfo 

Log message:
        * doc/groff.texinfo: Improve documentation of \R escape.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1229&r2=1.1230
http://cvs.savannah.gnu.org/viewcvs/groff/doc/groff.texinfo?cvsroot=groff&r1=1.288&r2=1.289

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1229
retrieving revision 1.1230
diff -u -b -r1.1229 -r1.1230
--- ChangeLog   10 Mar 2010 06:16:09 -0000      1.1229
+++ ChangeLog   1 May 2010 05:41:20 -0000       1.1230
@@ -1,3 +1,7 @@
+2010-05-01  Werner LEMBERG  <address@hidden>
+
+       * doc/groff.texinfo: Improve documentation of \R escape.
+
 2010-03-10  Werner LEMBERG  <address@hidden>
 
        * doc/groff.texinfo: Document \n[DD] register.

Index: doc/groff.texinfo
===================================================================
RCS file: /cvsroot/groff/groff/doc/groff.texinfo,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -b -r1.288 -r1.289
--- doc/groff.texinfo   10 Mar 2010 06:16:09 -0000      1.288
+++ doc/groff.texinfo   1 May 2010 05:41:20 -0000       1.289
@@ -5971,7 +5971,6 @@
 The @code{\R} escape doesn't produce an input token in @code{gtroff};
 in other words, it vanishes completely after @code{gtroff} has
 processed it.
address@hidden
 
 For example, the following two lines are equivalent:
 
@@ -5981,6 +5980,43 @@
     @result{} 1
 @endExample
 
+Note that the complete transparency of @code{\R} can cause surprising
+effects if you use number registers like @code{.k} which get evaluated
+at the time they are accessed.
+
address@hidden
+.ll 1.6i
+.
+aaa bbb ccc ddd eee fff ggg hhh\R':k \n[.k]'
+.tm :k == \n[:k]
+    @result{} :k == 126950
+.
+.br
+.
+aaa bbb ccc ddd eee fff ggg hhh\h'0'\R':k \n[.k]'
+.tm :k == \n[:k]
+    @result{} :k == 15000
address@hidden
+
+If you process this with the PostScript device (@code{-Tps}), there
+will be a line break eventually after @code{ggg} in both input lines. 
+However, after processing the space after @code{ggg}, the partially
+collected line is not overfull yet, so @code{troff} continues to
+collect input until it sees the space (or in this case, the newline)
+after @code{hhh}.  At this point, the line is longer than the line
+length, and the line gets broken.
+
+In the first input line, since the @code{\R} escape leaves no traces,
+the check for the overfull line hasn't been done yet at the point where
address@hidden gets handled, and you get a value for the @code{.k} number
+register which is even greater than the current line length.
+
+In the second input line, the insertion of @code{\h'0'} to emit an
+invisible zero-width space forces @code{troff} to check the line length
+which in turn causes the start of a new output line.  Now @code{.k}
+returns the expected value.
address@hidden
+
 Both @code{nr} and @code{\R} have two additional special forms to
 increment or decrement a register.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]