m4-patches
[Top][All Lists]
Advanced

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

Re: branch-1_4 - debian bug 53685: -s -I bug


From: Eric Blake
Subject: Re: branch-1_4 - debian bug 53685: -s -I bug
Date: Sun, 30 Jul 2006 21:45:05 +0000

> Agreed.  It also affects the __file__ macro.  Here's a patch that will
> make it in 1.4.6 that does just that:
> 
> 2006-07-29  Eric Blake  <address@hidden>
> 
>       * src/path.c (path_search): Add result parameter, so that
>       -I can be accounted for.  Debian bug 53685.

This deserves testsuite exposure, as patched below.

Also, I find it annoying that m4wrap always claims to be in
__file__ NONE and __line__ 0.  I hope to improve that situation
on head when I fix m4wrap to be FIFO, by storing the current
file and line number of where each piece of wrapped text was
captured along with the wrapped text.

2006-07-30  Eric Blake  <address@hidden>

        * doc/m4.texinfo (Errprint): Add example for last patch.
        * checks/check-them): Account for VPATH in latest example.

Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.55
diff -u -p -r1.1.1.1.2.55 m4.texinfo
--- doc/m4.texinfo      28 Jul 2006 01:45:04 -0000      1.1.1.1.2.55
+++ doc/m4.texinfo      30 Jul 2006 21:28:14 -0000
@@ -3995,6 +3995,26 @@ errprint(`m4:'__file__:__line__: `input 
 @result{}
 @end example
 
+Line numbers start at 1 for each file.  If the file was found due to the
address@hidden 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
address@hidden directory of the @acronym{GNU} M4 package, using
address@hidden/examples} in the command line to find the file
address@hidden mentioned earlier:
+
address@hidden
+define(`foo', ``$0' called at __file__:__line__')
address@hidden
+foo
address@hidden called at stdin:2
+include(`incl.m4')
address@hidden file start
address@hidden called at ../examples/incl.m4:2
address@hidden file end
address@hidden
address@hidden example
+
 @node M4exit
 @section Exiting from @code{m4}
 
Index: checks/check-them
===================================================================
RCS file: /sources/m4/m4/checks/Attic/check-them,v
retrieving revision 1.1.1.1.2.8
diff -u -p -r1.1.1.1.2.8 check-them
--- checks/check-them   8 Jul 2006 21:20:44 -0000       1.1.1.1.2.8
+++ checks/check-them   30 Jul 2006 21:28:14 -0000
@@ -54,7 +54,8 @@ do
     continue
   fi
 
-  sed -e '/^dnl @result{}/!d' -e 's///' "$file" > $xout
+  sed -e '/^dnl @result{}/!d' -e 's///' -e "s|\.\./examples|$examples|" \
+    "$file" > $xout
 
   if cmp -s $out $xout; then
     :




reply via email to

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