GNU bug report logs - #15303
24.3; [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: mcepl@HIDDEN (Matěj Cepl); dated Sat, 7 Sep 2013 22:06:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 15303 <at> debbugs.gnu.org:


Received: (at 15303) by debbugs.gnu.org; 9 Sep 2013 23:11:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 09 19:11:14 2013
Received: from localhost ([127.0.0.1]:51090 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VJAby-0002V6-6B
	for submit <at> debbugs.gnu.org; Mon, 09 Sep 2013 19:11:14 -0400
Received: from mx1.redhat.com ([209.132.183.28]:6247)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <mcepl@HIDDEN>) id 1VJAbt-0002Ut-Nu
 for 15303 <at> debbugs.gnu.org; Mon, 09 Sep 2013 19:11:11 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
 (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
 by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89NB8I0009827
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Mon, 9 Sep 2013 19:11:08 -0400
Received: from wycliff.ceplovi.cz (ovpn-116-17.ams2.redhat.com [10.36.116.17])
 by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with
 ESMTP id r89NB7HZ021619; Mon, 9 Sep 2013 19:11:08 -0400
Received: from wycliff.ceplovi.cz (wycliff.ceplovi.cz [127.0.0.1])
 by wycliff.ceplovi.cz (Postfix) with ESMTP id 120FA476A6;
 Tue, 10 Sep 2013 01:11:07 +0200 (CEST)
Message-ID: <522E558A.3000304@HIDDEN>
Date: Tue, 10 Sep 2013 01:11:06 +0200
From: =?UTF-8?B?TWF0xJtqIENlcGw=?= <mcepl@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:25.0) Gecko/20100101 Thunderbird/25.0a2
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#15303: 24.3; [diff-mode] diff-hunk-kill doesn't update numbers
 in subsequent hunks
References: <87a9jo4d04.fsf@HIDDEN>	<jwvsixdzx5t.fsf-monnier+emacs@HIDDEN>
 <522E12BE.5020304@HIDDEN> <jwvbo41zjcx.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvbo41zjcx.fsf-monnier+emacs@HIDDEN>
X-Enigmail-Version: 1.5.2
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="nI1DhH0cdtBltFwSaC0taFuLgHAWV01H1"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: 15303
Cc: 15303 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.9 (-----)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--nI1DhH0cdtBltFwSaC0taFuLgHAWV01H1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 09/10/2013 01:08 AM, Stefan Monnier wrote:
> Sounds like the perfect opportunity to get up to speed on Lisp.

I was nice and I haven't said my thoughts about Emacs and Lisp, right? ;)=


Mat=C4=9Bj

--=20
http://www.ceplovi.cz/matej/, Jabber: mcepl@HIDDEN
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC

God is not worried about my financial situation.


--nI1DhH0cdtBltFwSaC0taFuLgHAWV01H1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iD8DBQFSLlWL4J/vJdlkhKwRAuCsAJ46KxeFAmQwuAqrnA4/IgJM5SQ7+ACfejZz
KzKyzez/Aci3p+OpXVCphCo=
=vLfD
-----END PGP SIGNATURE-----

--nI1DhH0cdtBltFwSaC0taFuLgHAWV01H1--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#15303; Package emacs. Full text available.

Message received at 15303 <at> debbugs.gnu.org:


Received: (at 15303) by debbugs.gnu.org; 9 Sep 2013 23:08:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 09 19:08:37 2013
Received: from localhost ([127.0.0.1]:51080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VJAZQ-0002Ql-65
	for submit <at> debbugs.gnu.org; Mon, 09 Sep 2013 19:08:36 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:46534)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>)
 id 1VJAZM-0002QU-RD; Mon, 09 Sep 2013 19:08:33 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEhkQoDlymNUYFegxM
X-IPAS-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEhkQoDlymNUYFegxM
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27042520"
Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home)
 ([184.175.16.104])
 by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
 09 Sep 2013 19:05:05 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 41CF263031; Mon,  9 Sep 2013 19:08:22 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: =?utf-8?Q?Mat=C4=9Bj?= Cepl <mcepl@HIDDEN>
Subject: Re: bug#15303: 24.3;
 [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks
Message-ID: <jwvbo41zjcx.fsf-monnier+emacs@HIDDEN>
References: <87a9jo4d04.fsf@HIDDEN>
 <jwvsixdzx5t.fsf-monnier+emacs@HIDDEN> <522E12BE.5020304@HIDDEN>
Date: Mon, 09 Sep 2013 19:08:22 -0400
In-Reply-To: <522E12BE.5020304@HIDDEN> (=?utf-8?Q?=22Mat=C4=9Bj?=
 Cepl"'s message of "Mon, 09 Sep 2013 20:26:06 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 15303
Cc: 15303 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

severity 15303 wishlist
thanks

> I am afraid, I have no clue about Lisp at all (SICP is still lying on my
> bed table, but I am afraid it is used mostly as sleeping pills ;)).
> I have come to this problem while writing my own module for vim
> (http://gitorious.org/vim-diff_navigator/).

Sounds like the perfect opportunity to get up to speed on Lisp.

> While working with Fedora (and RHEL) packages I work a lot with patches,
> and it is often much more easy to actually edit patches (which are of
> course correct ones) than to apply all patches and regenerate patches.
> And quilt doesn't help everytime completely.
> And of course, we have --fuzz=0 everywhere in Fedora (and RHEL).
> So, yes, I understand where you are coming from, but I have a bit
> different use case.

I agree it would be generally good to update the numbers like you
request, but it's not a high-enough priority.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#15303; Package emacs. Full text available.

Message received at 15303 <at> debbugs.gnu.org:


Received: (at 15303) by debbugs.gnu.org; 9 Sep 2013 18:26:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 09 14:26:14 2013
Received: from localhost ([127.0.0.1]:50845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VJ6AA-0003xO-A4
	for submit <at> debbugs.gnu.org; Mon, 09 Sep 2013 14:26:14 -0400
Received: from mx1.redhat.com ([209.132.183.28]:59319)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <mcepl@HIDDEN>) id 1VJ6A7-0003x7-EJ
 for 15303 <at> debbugs.gnu.org; Mon, 09 Sep 2013 14:26:12 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
 (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
 by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89IQ8Ch002938
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Mon, 9 Sep 2013 14:26:08 -0400
Received: from wycliff.ceplovi.cz (ovpn-116-17.ams2.redhat.com [10.36.116.17])
 by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with
 ESMTP id r89IQ7EE019692; Mon, 9 Sep 2013 14:26:08 -0400
Received: from wycliff.ceplovi.cz (wycliff.ceplovi.cz [127.0.0.1])
 by wycliff.ceplovi.cz (Postfix) with ESMTP id 32DFB40A38;
 Mon,  9 Sep 2013 20:26:07 +0200 (CEST)
Message-ID: <522E12BE.5020304@HIDDEN>
Date: Mon, 09 Sep 2013 20:26:06 +0200
From: =?UTF-8?B?TWF0xJtqIENlcGw=?= <mcepl@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:25.0) Gecko/20100101 Thunderbird/25.0a2
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#15303: 24.3; [diff-mode] diff-hunk-kill doesn't update numbers
 in subsequent hunks
References: <87a9jo4d04.fsf@HIDDEN>
 <jwvsixdzx5t.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvsixdzx5t.fsf-monnier+emacs@HIDDEN>
X-Enigmail-Version: 1.5.2
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="IA1KT0tl6MxDOwjRq1rq3IbUV4tSIhrkD"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: 15303
Cc: 15303 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.9 (-----)

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--IA1KT0tl6MxDOwjRq1rq3IbUV4tSIhrkD
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 09/09/2013 08:18 PM, Stefan Monnier wrote:
> I might accept a patch which fixes this issue, but doing it right
> (e.g. handle all the different kinds of hunks we support, disregard
> subsequent hunks that apply to other files, ...) might prove too comple=
x
> for the benefit.

I am afraid, I have no clue about Lisp at all (SICP is still lying on my
bed table, but I am afraid it is used mostly as sleeping pills ;)). I
have come to this problem while writing my own module for vim
(http://gitorious.org/vim-diff_navigator/).

> The problem also is that this presumes a particular use case (you get
> a diff for file FOO, then you remove some of the hunks to extract
> a sub-diff that will apply to the same file).

While working with Fedora (and RHEL) packages I work a lot with patches,
and it is often much more easy to actually edit patches (which are of
course correct ones) than to apply all patches and regenerate patches.
And quilt doesn't help everytime completely.

And of course, we have --fuzz=3D0 everywhere in Fedora (and RHEL).

So, yes, I understand where you are coming from, but I have a bit
different use case.

> But there are other uses cases where the current behavior is "right".
> E.g. I mainly use M-k in .rej files after I applied the corresponding
> hunk by hand, in which case the subsequent hunks shouldn't be updated.
> Admittedly, for a .rej file, the exact line numbers are often not quite=

> right, so it wouldn't make things worse to update subsequent hunks.

OTOH, my script in the worst case doesn't make things worse.

Best,

Mat=C4=9Bj
--=20
http://www.ceplovi.cz/matej/, Jabber: mcepl@HIDDEN
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC

Our lives are spectacles of powerlessness.
    -- Richard Rohr


--IA1KT0tl6MxDOwjRq1rq3IbUV4tSIhrkD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iD8DBQFSLhK+4J/vJdlkhKwRArUEAJ0XU7h3BVwcw0i+XqWti/Wxydb8sACghLJ/
gZcPfT7EoCd2F4Ov6wRWajM=
=ck/G
-----END PGP SIGNATURE-----

--IA1KT0tl6MxDOwjRq1rq3IbUV4tSIhrkD--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#15303; Package emacs. Full text available.

Message received at 15303 <at> debbugs.gnu.org:


Received: (at 15303) by debbugs.gnu.org; 9 Sep 2013 18:18:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 09 14:18:22 2013
Received: from localhost ([127.0.0.1]:50837 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VJ62Y-0003l5-9a
	for submit <at> debbugs.gnu.org; Mon, 09 Sep 2013 14:18:22 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:61676)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1VJ62V-0003ko-FP
 for 15303 <at> debbugs.gnu.org; Mon, 09 Sep 2013 14:18:20 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgbBLZEKA6R6gV6DEw
X-IPAS-Result: Av4EABK/CFG4rxBo/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgbBLZEKA6R6gV6DEw
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="27002721"
Received: from 184-175-16-104.dsl.teksavvy.com (HELO pastel.home)
 ([184.175.16.104])
 by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
 09 Sep 2013 14:14:53 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 3A0CC62F86; Mon,  9 Sep 2013 14:18:13 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: mcepl@HIDDEN (=?utf-8?Q?Mat=C4=9Bj?= Cepl)
Subject: Re: bug#15303: 24.3;
 [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks
Message-ID: <jwvsixdzx5t.fsf-monnier+emacs@HIDDEN>
References: <87a9jo4d04.fsf@HIDDEN>
Date: Mon, 09 Sep 2013 14:18:13 -0400
In-Reply-To: <87a9jo4d04.fsf@HIDDEN> (=?utf-8?Q?=22Mat=C4=9Bj?=
 Cepl"'s message of "Sat, 07 Sep 2013 22:01:47 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 15303
Cc: 15303 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> That's actually wrong.  The original hunk added three lines to the new
> file, so when it is killed, the new line number in the hunk header
> should be decreased by three, so the line should be

Indeed, currently, diff-mode does not try very hard (if at all) to keep
the line numbers correct, and instead presumes that the hunks will be
applied "fuzzily".

I might accept a patch which fixes this issue, but doing it right
(e.g. handle all the different kinds of hunks we support, disregard
subsequent hunks that apply to other files, ...) might prove too complex
for the benefit.

The problem also is that this presumes a particular use case (you get
a diff for file FOO, then you remove some of the hunks to extract
a sub-diff that will apply to the same file).

But there are other uses cases where the current behavior is "right".
E.g. I mainly use M-k in .rej files after I applied the corresponding
hunk by hand, in which case the subsequent hunks shouldn't be updated.
Admittedly, for a .rej file, the exact line numbers are often not quite
right, so it wouldn't make things worse to update subsequent hunks.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#15303; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Sep 2013 22:05:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 07 18:05:16 2013
Received: from localhost ([127.0.0.1]:47844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VIQd1-0008PM-IE
	for submit <at> debbugs.gnu.org; Sat, 07 Sep 2013 18:05:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52299)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <matej@HIDDEN>) id 1VIQ20-0007Sn-9c
 for submit <at> debbugs.gnu.org; Sat, 07 Sep 2013 17:27:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <matej@HIDDEN>) id 1VIQ1p-00068D-Kn
 for submit <at> debbugs.gnu.org; Sat, 07 Sep 2013 17:26:54 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:41758)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <matej@HIDDEN>) id 1VIQ1p-000689-Hc
 for submit <at> debbugs.gnu.org; Sat, 07 Sep 2013 17:26:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54002)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <matej@HIDDEN>) id 1VIQ1k-0001G2-Pc
 for bug-gnu-emacs@HIDDEN; Sat, 07 Sep 2013 17:26:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <matej@HIDDEN>) id 1VIQ1g-00067S-0W
 for bug-gnu-emacs@HIDDEN; Sat, 07 Sep 2013 17:26:44 -0400
Received: from 184.109.broadband10.iol.cz ([90.177.109.184]:33995
 helo=wycliff.ceplovi.cz) by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <matej@HIDDEN>) id 1VIQ1f-00067C-J0
 for bug-gnu-emacs@HIDDEN; Sat, 07 Sep 2013 17:26:39 -0400
Received: by wycliff.ceplovi.cz (Postfix, from userid 1000)
 id 8E81D40AD5; Sat,  7 Sep 2013 22:01:47 +0200 (CEST)
From: mcepl@HIDDEN (=?utf-8?Q?Mat=C4=9Bj?= Cepl)
To: bug-gnu-emacs@HIDDEN
Subject: 24.3;
 [diff-mode] diff-hunk-kill doesn't update numbers in subsequent hunks
Date: Sat, 07 Sep 2013 22:01:47 +0200
Message-ID: <87a9jo4d04.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sat, 07 Sep 2013 18:05:14 -0400
Cc: phracek@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.4 (---)

1) Start Emacs
2) Open a patch file, it will open in a diff-mode
3) kill a hunk (Alt-K)

Example:

Let's have a patch with two subsequent hunks:

 curves =3D [
@@ -108,6 +117,9 @@ Hunk #2, a/tests/test_ec_curves.py curves =3D [
 #    ('ipsec4', 185),
 #]
=20
+
+@unittest.skipUnless(EC_Module_Available,
+                     'Requires EC modules compiled into OpenSSL')
 class ECCurveTests(unittest.TestCase):
     #data =3D sha.sha('Kilroy was here!').digest()     # 160 bits
     data =3D "digest"     # keep short (48 bits) so lesser curves=20
@@ -153,7 +165,8 @@ Hunk #3, a/tests/test_ec_curves.py def suite():
=20
[end of example]=20

When I am on line with @unittest.skipUnless and press Alt-K the result
is:

 curves =3D [
@@ -153,7 +165,8 @@ Hunk #3, a/tests/test_ec_curves.py def suite():

[end of example]=20

That's actually wrong. The original hunk added three lines to the new
file, so when it is killed, the new line number in the hunk header
should be decreased by three, so the line should be

@@ -153,7 +162,8 @@

Best,

Mat=C4=9Bj Cepl


In GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2)
 of 2013-07-22 on x86-019.build.eng.bos.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.11402000
System Description:	Red Hat Enterprise Linux Workstation release 7.0 Beta (=
Maipo)

Configured using:
 `configure '--build=3Dx86_64-redhat-linux-gnu'
 '--host=3Dx86_64-redhat-linux-gnu' '--program-prefix=3D'
 '--disable-dependency-tracking' '--prefix=3D/usr' '--exec-prefix=3D/usr'
 '--bindir=3D/usr/bin' '--sbindir=3D/usr/sbin' '--sysconfdir=3D/etc'
 '--datadir=3D/usr/share' '--includedir=3D/usr/include'
 '--libdir=3D/usr/lib64' '--libexecdir=3D/usr/libexec'
 '--localstatedir=3D/var' '--sharedstatedir=3D/var/lib'
 '--mandir=3D/usr/share/man' '--infodir=3D/usr/share/info' '--with-dbus'
 '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff'
 '--with-xft' '--with-xpm' '--with-x-toolkit=3Dgtk3' '--with-gpm=3Dno'
 'build_alias=3Dx86_64-redhat-linux-gnu'
 'host_alias=3Dx86_64-redhat-linux-gnu' 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector
 --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches -m64 -mtune=3Dgeneric'
 'LDFLAGS=3D-Wl,-z,relro ''

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=3Dibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Diff

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x 5 2 <switch-frame> <help-echo> M-x <up> r e p o=20
r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
user-error: Beginning of history; no preceding item

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils vc-git diff-mode easymenu easy-mmode time-date
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)




Acknowledgement sent to mcepl@HIDDEN (Matěj Cepl):
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#15303; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.