m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/doc/m4.texinfo,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/doc/m4.texinfo,v [branch-1_4]
Date: Tue, 08 Aug 2006 23:17:45 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/08/08 23:17:44

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.61
retrieving revision 1.1.1.1.2.62
diff -u -b -r1.1.1.1.2.61 -r1.1.1.1.2.62
--- doc/m4.texinfo      4 Aug 2006 13:19:41 -0000       1.1.1.1.2.61
+++ doc/m4.texinfo      8 Aug 2006 23:17:44 -0000       1.1.1.1.2.62
@@ -2317,7 +2317,7 @@
 ')0 hi dnl 1 hi')
 @result{}
 ^D
address@hidden:NONE:0: Warning: end of file treated as newline
address@hidden: Warning: end of file treated as newline
 @result{}0 HI 2 HI
 @end example
 
@@ -2839,7 +2839,7 @@
 m4wrap(`m4wrap(`)')len(abc')
 @result{}
 ^D
address@hidden:NONE:0: ERROR: end of file in argument list
address@hidden: ERROR: end of file in argument list
 @end example
 
 @node File Inclusion
@@ -4103,8 +4103,11 @@
 
 Line numbers start at 1 for each file.  If the file was found due to the
 @option{-I} option or @env{M4PATH} environment variable, that is
-reflected in the file name.  The syncline option (@option{-s}) uses the
-same notion of current file and line.  Assume this example is run in the
+reflected in the file name.  The syncline option (@option{-s}), and the
address@hidden and @samp{l} flags of @code{debugmode} (@pxref{Debug Levels}),
+also use this notion of current file and line.  Redefining the three
+location macros has no effect on syncline, debug, or warning message
+output.  Assume this example is run in the
 @file{checks} directory of the @acronym{GNU} M4 package, using
 @samp{--include=../examples} in the command line to find the file
 @file{incl.m4} mentioned earlier:
@@ -4122,7 +4125,7 @@
 @end example
 
 Currently, all text wrapped with @code{m4wrap} (@pxref{M4wrap}) behaves
-as though it came from line 0 of the file ``NONE''.  It is hoped that a
+as though it came from line 0 of the file ``''.  It is hoped that a
 future release of @code{m4} can overcome this limitation and remember
 which file invoked the call to @code{m4wrap}.
 
@@ -4171,7 +4174,9 @@
 After this macro call, @code{m4} will exit with exit status 1.  This macro
 is only intended for error exits, since the normal exit procedures are
 not followed, e.g., diverted text is not undiverted, and saved text
-(@pxref{M4wrap}) is not reread.
+(@pxref{M4wrap}) is not reread.  (This macro has a subtle bug, when
+invoked from wrapped text.  You should try to see if you can find it and
+correct it.  @pxref{Answers})
 
 @example
 m4wrap(`This text is lost to `m4exit'.')
@@ -4727,6 +4732,29 @@
 @result{}
 @end example
 
+The @code{fatal_error} macro (@pxref{M4exit}) does not quite match the
+format of internal error messages when invoked inside wrapped text, due
+to the current limitations of @code{__file__} (@pxref{Location}) when
+invoked inside @code{m4wrap}.  Since @code{m4} omits the file and line
+number from its warning messages when there is no current file (or
+equivalently, when the current line is 0, since all files start at line
+1), a better implementation would be:
+
address@hidden
+define(`fatal_error',
+  `errprint(__program__:ifelse(__line__, `0', `',
+    `__file__:__line__:')` fatal error: $*
+')m4exit(`1')')
address@hidden
+m4wrap(`divnum(`demo of internal message')
+fatal_error(`inside wrapped text')')
address@hidden
+^D
address@hidden: Warning: excess arguments to builtin `divnum' ignored
address@hidden
address@hidden: fatal error: inside wrapped text
address@hidden example
+
 @c ========================================================== Appendices
 
 @node Copying This Manual




reply via email to

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