[Top][All Lists]

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

Re: autoupdate fun

From: Ralf Wildenhues
Subject: Re: autoupdate fun
Date: Mon, 27 Mar 2006 20:06:57 +0200
User-agent: Mutt/1.5.9i

Hi Stepan,

> * Stepan Kasal wrote on Wed, Mar 22, 2006 at 12:49:20AM CET:
> >   I have a patch prepared on my disk.
> > The problem was that if started with
> >     AC_PREREQ(2.54)
> >     m4_define([gnumeric_version_epoch], [1])
> >     ...
> > then the m4_define disappeared after an autoupdate run.
> > 
> > The fix happen to be quite a big change, but I'm quite sure it makes
> > things more consistent.  Please see the attached patch.

How about this patch on top of yours?  It turns this:

$ cat
$ autoupdate warning: AC_CYGWIN is obsolete: use AC_CANONICAL_HOST and 
check if $host_os
matches *cygwin*

into this:

$ autoupdate warning: AC_CYGWIN is obsolete: use AC_CANONICAL_HOST and check 
if $host_os
matches *cygwin*

?  Note the last changed line is a bit underquoted, but I think it is ok
to expect that neither _au__first_line nor _first_line have been defined
before (else it would need another round of changequotes inside that
last line before the user line).

Alternatively, do you think we should rather redefine __line__ (so that
whatever user code may use that also gets the correct lines)?


        * bin/ Redefine m4_location so that warnings print
        the correct lines of the input file by subtracting..
        (_au__first_line): ..this new definition.

--- bin/   2006-03-27 19:50:55.000000000 +0200
+++ bin/   2006-03-27 19:51:35.000000000 +0200
@@ -288,6 +288,9 @@
       # Redefine __file__ to make warnings nicer; $file is replaced below.
       m4_define([__file__], [$file])
+      # Redefine m4_location to fix the line number.
+      m4_define([m4_location], [__file__:m4_eval(__line__ - _au__first_line)])
       # Move all the builtins into the `_au_' pseudo namespace
@@ -373,11 +376,11 @@
       # `_au_disable' would be wrong.
-      # Disable special characters.
+      # Disable special characters, and set the first line number.
-      _au__divert(0)_au_dnl
+      _au_m4_define(_au__first_line, _au___line__)_au__divert(0)_au_dnl
     $input_m4 =~ s/^      //mg;

reply via email to

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