CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 07/05/25 17:27:37
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.124
retrieving revision 1.1.1.1.2.125
diff -u -b -r1.1.1.1.2.124 -r1.1.1.1.2.125
--- doc/m4.texinfo 25 May 2007 12:58:50 -0000 1.1.1.1.2.124
+++ doc/m4.texinfo 25 May 2007 17:27:36 -0000 1.1.1.1.2.125
@@ -664,7 +664,8 @@
Synchronization directives are always given on complete lines by
themselves. When a synchronization discrepancy occurs in the middle of
an output line, the associated synchronization directive is delayed
-until the beginning of the next generated line.
+until the next newline that does not occur in the middle of a quoted
+string or comment.
@comment options: -s
@example
@@ -672,15 +673,31 @@
2')
@result{}#line 2 "stdin"
@result{}
+changecom(`/*', `*/')
[EMAIL PROTECTED]
+define(`comment', `/*1
+2*/')
[EMAIL PROTECTED] 5
[EMAIL PROTECTED]
dnl no line
hello
[EMAIL PROTECTED] 4
[EMAIL PROTECTED] 7
@result{}hello
twoline
@result{}1
[EMAIL PROTECTED] 5
[EMAIL PROTECTED] 8
@result{}2
+comment
[EMAIL PROTECTED]/*1
[EMAIL PROTECTED]/
+one comment `two
+three'
[EMAIL PROTECTED] 10
[EMAIL PROTECTED] /*1
[EMAIL PROTECTED]/ two
[EMAIL PROTECTED]
goodbye
[EMAIL PROTECTED] 12
@result{}goodbye
@end example
@@ -6151,7 +6168,29 @@
The sync line option is used mostly when using @code{m4} as
a front end to a compiler. If a diverted line causes a compiler error,
the error messages should most probably refer to the place where the
-diversion were made, and not where it was inserted again.
+diversion was made, and not where it was inserted again.
+
[EMAIL PROTECTED] options: -s
[EMAIL PROTECTED]
+divert(2)2
+divert(1)1
+divert`'0
[EMAIL PROTECTED] 3 "stdin"
[EMAIL PROTECTED]
+^D
[EMAIL PROTECTED] 2 "stdin"
[EMAIL PROTECTED]
[EMAIL PROTECTED] 1 "stdin"
[EMAIL PROTECTED]
[EMAIL PROTECTED] example
+
+The current @code{m4} implementation has a limitation that the syncline
+output at the start of each diversion occurs no matter what, even if the
+previous diversion did not end with a newline. This goes contrary to
+the claim that synclines appear on a line by themselves, so this
+limitation may be corrected in a future version of @code{m4}. In the
+meantime, when using @option{-s}, it is wisest to make sure all
+diversions end with newline.
@item
@acronym{GNU} @code{m4} makes no attempt at prohibiting self-referential