From MAILER-DAEMON Thu Mar 04 17:28:03 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NnJWV-0003VB-Cx
	for mharc-bug-diffutils@gnu.org; Thu, 04 Mar 2010 17:28:03 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NnAyn-0006nR-Mf
	for bug-diffutils@gnu.org; Thu, 04 Mar 2010 08:20:41 -0500
Received: from [140.186.70.92] (port=40652 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NnAym-0006mP-Fk
	for bug-diffutils@gnu.org; Thu, 04 Mar 2010 08:20:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <yannick.moy@adacore.com>) id 1NnAyl-0007L8-IJ
	for bug-diffutils@gnu.org; Thu, 04 Mar 2010 08:20:40 -0500
Received: from mel.act-europe.fr ([212.99.106.210]:41169)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <yannick.moy@adacore.com>) id 1NnAyl-0007J2-A0
	for bug-diffutils@gnu.org; Thu, 04 Mar 2010 08:20:39 -0500
Received: from localhost (localhost [127.0.0.1])
	by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id E3CE0CB0265
	for <bug-diffutils@gnu.org>; Thu,  4 Mar 2010 14:20:16 +0100 (CET)
X-Virus-Scanned: amavisd-new at eu.adacore.com
Received: from mel.act-europe.fr ([127.0.0.1])
	by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GYAUZaDBbTa0 for <bug-diffutils@gnu.org>;
	Thu,  4 Mar 2010 14:20:16 +0100 (CET)
Received: from [192.168.1.11] (AMarseille-551-1-20-129.w80-9.abo.wanadoo.fr
	[80.9.83.129])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mel.act-europe.fr (Postfix) with ESMTP id 99FEBCB0264
	for <bug-diffutils@gnu.org>; Thu,  4 Mar 2010 14:20:16 +0100 (CET)
Message-ID: <4B8FB390.5090802@adacore.com>
Date: Thu, 04 Mar 2010 14:20:16 +0100
From: Yannick Moy <yannick.moy@adacore.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.8.1.23) Gecko/20090817 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: bug-diffutils@gnu.org
Content-Type: multipart/mixed; boundary="------------070304090304080809020709"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Mailman-Approved-At: Thu, 04 Mar 2010 17:28:02 -0500
Subject: [bug-diffutils] [PATCH] remove initial blank characters in context
	function line
X-BeenThere: bug-diffutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Mar 2010 13:20:42 -0000

This is a multi-part message in MIME format.
--------------070304090304080809020709
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

* src/diff.c (print_context_function): For languages like Ada
which allow local functions and procedures, the plain context
function line may start with enough blank characters that the
function name does not get completely printed in the 40
characters limit. This patch solves this problem by removing
these useless initial blank characters.
---
Hi,

Here is a patch that I hope you can integrate.

Besides, I'd really like the limit of 40 characters to be larger, say 60.
In Ada it is quite common to have long explicit function names.

I attached two files adacode.adb and adacode2.adb where the problem shows, when
diffing with

$ diff -c -F '^[[:space:]]*\(function\|procedure\)' adacode.adb adacode2.adb

the result starts with

***************                     procedure Local_Leve
*** 9,15 ****

Here is a possible description for the NEWS:

* Context function line skips initial blank characters, which arise
  in languages which allow the definition of local functions, in order
  to get the complete function name when possible.

Best regards,

Yannick Moy

 src/context.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/context.c b/src/context.c
index e918134..84120f0 100644
--- a/src/context.c
+++ b/src/context.c
@@ -145,13 +145,15 @@ print_context_number_range (struct file_data const *file,
lin a, lin b)
 static void
 print_context_function (FILE *out, char const *function)
 {
-  int i;
+  int i, j;
   putc (' ', out);
-  for (i = 0; i < 40 && function[i] != '\n'; i++)
+  for (i = 0; isspace ((unsigned char)function[i]) && function[i] != '\n'; i++)
     continue;
-  while (0 < i && isspace ((unsigned char) function[i - 1]))
-    i--;
-  fwrite (function, sizeof (char), i, out);
+  for (j = i; j < i + 40 && function[j] != '\n'; j++)
+    continue;
+  while (i < j && isspace ((unsigned char) function[j - 1]))
+    j--;
+  fwrite (function + i, sizeof (char), j - i, out);
 }
 
 /* Print a portion of an edit script in context format.
-- 
1.6.3.3



--------------070304090304080809020709
Content-Type: text/x-adasrc;
 name="adacode.adb"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="adacode.adb"

procedure AdaCode is
    procedure Local_Level_1 is
        procedure Local_Level_2 is
            procedure Local_Level_3 is
                procedure Local_Level_4 is
                    procedure Local_Level_5 is
                    begin
                        null;
                        null;
                        null;
                        null;
                        null;
                    end;
                begin
                    Local_Level_5;
                end;
            begin
                Local_Level_4;
            end;
        begin
            Local_Level_3;
        end;
    begin
        Local_Level_2;
    end;
begin
    Local_Level_1;
end;


--------------070304090304080809020709
Content-Type: text/x-adasrc;
 name="adacode2.adb"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="adacode2.adb"

procedure AdaCode is
    procedure Local_Level_1 is
        procedure Local_Level_2 is
            procedure Local_Level_3 is
                procedure Local_Level_4 is
                    procedure Local_Level_5 is
                    begin
                        null;
                        null;
                        null;
                        null;
                        if True then
                            null;
                        end if;   
                    end;
                begin
                    Local_Level_5;
                end;
            begin
                Local_Level_4;
            end;
        begin
            Local_Level_3;
        end;
    begin
        Local_Level_2;
    end;
begin
    Local_Level_1;
end;


--------------070304090304080809020709--



From MAILER-DAEMON Wed Mar 17 10:54:10 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NrudO-0003LW-Hb
	for mharc-bug-diffutils@gnu.org; Wed, 17 Mar 2010 10:54:10 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NrudM-0003Kt-Sa
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 10:54:08 -0400
Received: from [140.186.70.92] (port=46982 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NrudL-0003Kd-AT
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 10:54:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NrudJ-0008QI-Vb
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 10:54:07 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:60817)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NrudJ-0008Q4-CP
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 10:54:05 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 46910818023
	for <bug-diffutils@gnu.org>; Wed, 17 Mar 2010 15:54:00 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 67293818054
	for <bug-diffutils@gnu.org>; Wed, 17 Mar 2010 15:53:58 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 4BCEB596; Wed, 17 Mar 2010 15:53:58 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-diffutils@gnu.org
Date: Wed, 17 Mar 2010 15:53:58 +0100
Message-ID: <87pr33yp6h.fsf@meyering.net>
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-diffutils] [PATCH] build: make bootstrap ensure that help2man
	is available
X-BeenThere: bug-diffutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Mar 2010 14:54:09 -0000

Thanks to Rob Vermaas for setting up the nixos hydra autobuilder:

    http://hydra.nixos.org/jobset/gnu/diffutils-master

Here's a fix for the first problem it exposed:

>From 61fb56b31483ae1c3d483ce099d3468697d37a75 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 17 Mar 2010 15:52:05 +0100
Subject: [PATCH] build: make bootstrap ensure that help2man is available

* bootstrap.conf (buildreq): Add help2man.
---
 bootstrap.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index a0eb0c4..343d660 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -123,6 +123,7 @@ autopoint  -
 gettext    -
 git        1.4.4
 gzip       -
+help2man   1.36
 makeinfo   -
 perl       5.5
 rsync      -
--
1.7.0.2.451.g960ec



From MAILER-DAEMON Wed Mar 17 11:54:49 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nrva4-00026J-P1
	for mharc-bug-diffutils@gnu.org; Wed, 17 Mar 2010 11:54:48 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nrva2-00025B-DI
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 11:54:46 -0400
Received: from [140.186.70.92] (port=36424 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nrva0-00024B-LA
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 11:54:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NrvZy-0007Em-8m
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 11:54:43 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:38576)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@meyering.net>) id 1NrvZx-0007EZ-MA
	for bug-diffutils@gnu.org; Wed, 17 Mar 2010 11:54:42 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id ECE2C818073
	for <bug-diffutils@gnu.org>; Wed, 17 Mar 2010 16:54:37 +0100 (CET)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 1B8C9818143
	for <bug-diffutils@gnu.org>; Wed, 17 Mar 2010 16:54:35 +0100 (CET)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 02027980; Wed, 17 Mar 2010 16:54:34 +0100 (CET)
From: Jim Meyering <jim@meyering.net>
To: bug-diffutils@gnu.org
Date: Wed, 17 Mar 2010 16:54:34 +0100
Message-ID: <878w9rymdh.fsf@meyering.net>
Lines: 52
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
Subject: [bug-diffutils] [PATCH] build: don't require a specific version of
	help2man
X-BeenThere: bug-diffutils@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "All diffutils discussion." <bug-diffutils.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-diffutils>
List-Post: <mailto:bug-diffutils@gnu.org>
List-Help: <mailto:bug-diffutils-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-diffutils>,
	<mailto:bug-diffutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Mar 2010 15:54:46 -0000

Rather than investigating this failure,

  http://hydra.nixos.org/build/327284

`/nix/store/rr5pvm247jgv2nhd59xv1d0cq7jazvzw-git-export/top/maint.mk' -> `../gnulib/top/maint.mk'
`/nix/store/rr5pvm247jgv2nhd59xv1d0cq7jazvzw-git-export/users.txt' -> `../gnulib/users.txt'
Error: 'help2man' version == GNU help21.36 is too old
       'help2man' version >= 1.36 is required

Program    Min_version
----------------------
autoconf   2.61
automake   1.11
autopoint  -
gettext    -
git        1.4.4
gzip       -
help2man   1.36
makeinfo   -
perl       5.5
rsync      -
tar        -

I've just done this:


>From d9c2b10e33c2fd073a10e7770c859c16001592f9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 17 Mar 2010 16:53:17 +0100
Subject: [PATCH] build: don't require a specific version of help2man

* bootstrap.conf (buildreq): Bootstrap can't deal with it,
perhaps because the command name contains a digit.
---
 bootstrap.conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 343d660..2e45a89 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -123,7 +123,7 @@ autopoint  -
 gettext    -
 git        1.4.4
 gzip       -
-help2man   1.36
+help2man   -
 makeinfo   -
 perl       5.5
 rsync      -
--
1.7.0.2.451.g960ec



