From unknown Wed Sep 10 19:49:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#4368 <4368@debbugs.gnu.org> To: bug#4368 <4368@debbugs.gnu.org> Subject: Status: 23.1; diff-hunk-kill -vs- final hunk in a file Reply-To: bug#4368 <4368@debbugs.gnu.org> Date: Thu, 11 Sep 2025 02:49:13 +0000 retitle 4368 23.1; diff-hunk-kill -vs- final hunk in a file reassign 4368 emacs submitter 4368 Tom Tromey severity 4368 normal thanks From tromey@redhat.com Mon Sep 7 21:13:40 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Sep 2009 04:13:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,FOURLA,IMPRONONCABLE_2, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n884Dc9l013990 for ; Mon, 7 Sep 2009 21:13:40 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mks5K-0000Pc-9u for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 00:13:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mks5F-0000Hl-Js for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 00:13:37 -0400 Received: from [199.232.76.173] (port=55109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mks5F-0000Hi-Db for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 00:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3879) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mks5F-0007bx-0V for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 00:13:33 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n884DUEn029692 for ; Tue, 8 Sep 2009 00:13:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n884DTj5028740; Tue, 8 Sep 2009 00:13:30 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n884DS2C011483; Tue, 8 Sep 2009 00:13:28 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id B383B378242; Mon, 7 Sep 2009 22:13:27 -0600 (MDT) From: Tom Tromey To: bug-gnu-emacs@gnu.org Subject: 23.1; diff-hunk-kill -vs- final hunk in a file Reply-To: Tom Tromey X-Attribution: Tom Date: Mon, 07 Sep 2009 22:13:27 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: I'm using diff-mode to edit a patch. The patch was generated by "git diff". I typed M-k to remove the last hunk in a file. However, it left the "header" around: diff --git a/src/data.c b/src/data.c index 7b59673..9063cef 100644 --- a/src/data.c +++ b/src/data.c diff --git a/src/eval.c b/src/eval.c index 4b7aa32..dbaa385 100644 --- a/src/eval.c [...] This yielded an invalid patch. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-redhat-linux-gnu, GTK+ Version 2.16.5) of 2009-08-24 on x86-2.fedora.phx.redhat.com Windowing system distributor `The X.Org Foundation', version 11.0.10601901 configured using `configure '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i586-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=i386-redhat-linux-gnu' 'host_alias=i386-redhat-linux-gnu' 'target_alias=i586-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Diff Minor modes in effect: shell-dirtrack-mode: t diff-auto-refine-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-track-minor-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-spelling-mode: t erc-truncate-mode: t erc-status-mode: t erc-services-mode: t erc-networks-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: g i t - r e v e r t RET C-x o C-x 1 C-v C-v C-l ESC v C-x b * s h TAB RET f r o m RET C-x b RET C-l ESC v C-h u g i t - r e s e t RET C-x o C-x 1 C-v C-v C-v C-v C-v k C-x b * s h TAB RET C-r 8 a 9 C-w C-r C-r C-r C-r C-x C-f / t m p / L RET C-s C-s C-a ESC v ESC v ESC v ESC v C-x b RET ESC p ESC p ESC DEL Q ESC b ESC b ESC b ESC b ESC t C-_ ESC f ESC t RET C-x C-f / t m p / Q RET C-v C-v C-x k RET g i t C-a C-k . RET g i t SPC a p p l y SPC / t m p / Q RET g i t SPC s t a t u s RET C-c C-o g i t SPC c o m m i t SPC - a SPC - m ' r e v e r t SPC a SPC f e w SPC p a t c h e s SPC b y SPC h n d DEL DEL a n d ' RET g i t SPC a p p l y SPC t / DEL DEL / t m p / P RET C-x C-f / t m p / P RET C-c g 1 4 6 RET ESC x r e p o r t - e m TAB b TAB RET d i f f - C-g C-h k ESC k ESC x r e p o r t - e m TAB b TAB RET Recent messages: Please wait: formatting the git-reset man page... git-reset man page formatted Mark saved where search started [2 times] call-interactively: Beginning of buffer [4 times] History item: 1 History item: 2 Undo! Mark set Quit Type C-x 1 to delete the help window. Tom From schwab@linux-m68k.org Tue Sep 8 02:14:44 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Sep 2009 09:14:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n889Egms002894 for ; Tue, 8 Sep 2009 02:14:44 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mkwmg-0003MI-2u for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 05:14:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mkwma-0003FU-DP for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 05:14:40 -0400 Received: from [199.232.76.173] (port=49928 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MkwmZ-0003Ew-Gi for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 05:14:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16905) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MkwmZ-0008Rb-44 for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 05:14:35 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n889ESet026250; Tue, 8 Sep 2009 05:14:28 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n889EPZI017773; Tue, 8 Sep 2009 05:14:26 -0400 From: Andreas Schwab To: Tom Tromey Cc: 4368@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#4368: 23.1; diff-hunk-kill -vs- final hunk in a file References: X-Yow: Disco oil bussing will create a throbbing naugahide pipeline running straight to the tropics from the rug producing regions and devalue the dollar! Date: Tue, 08 Sep 2009 11:14:25 +0200 In-Reply-To: (Tom Tromey's message of "Mon, 07 Sep 2009 22:13:27 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 Tom Tromey writes: > I'm using diff-mode to edit a patch. > The patch was generated by "git diff". > I typed M-k to remove the last hunk in a file. > However, it left the "header" around: Use M-K instead, this will also remove the header. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From tromey@redhat.com Tue Sep 8 08:43:49 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 8 Sep 2009 15:43:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n88Fhmpm011251 for ; Tue, 8 Sep 2009 08:43:49 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ml2rD-0002Qy-QQ for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 11:43:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ml2r8-0002PV-7n for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 11:43:46 -0400 Received: from [199.232.76.173] (port=37977 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ml2r8-0002PN-42 for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 11:43:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34383) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ml2r7-00039F-Gg for bug-gnu-emacs@gnu.org; Tue, 08 Sep 2009 11:43:41 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n88Fha2D027228; Tue, 8 Sep 2009 11:43:36 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n88FhYdA013684; Tue, 8 Sep 2009 11:43:35 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n88FhVnj031466; Tue, 8 Sep 2009 11:43:31 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id EF58837817D; Tue, 8 Sep 2009 09:43:30 -0600 (MDT) From: Tom Tromey To: Andreas Schwab Cc: 4368@debbugs.gnu.org, bug-gnu-emacs@gnu.org Subject: Re: bug#4368: 23.1; diff-hunk-kill -vs- final hunk in a file References: Reply-To: Tom Tromey X-Attribution: Tom Date: Tue, 08 Sep 2009 09:43:30 -0600 In-Reply-To: (Andreas Schwab's message of "Tue, 08 Sep 2009 11:14:25 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-CrossAssassin-Score: 2 >>>>> "Andreas" == Andreas Schwab writes: >> I'm using diff-mode to edit a patch. >> The patch was generated by "git diff". >> I typed M-k to remove the last hunk in a file. >> However, it left the "header" around: Andreas> Use M-K instead, this will also remove the header. Yeah, I knew about M-K. I was editing the patch, deleting hunks one-by-one, and I didn't notice that I was about to delete the last hunk from a file. It would be nicer if diff-mode handled this for me, so that I didn't accidentally create a bogus patch. Tom From monnier@IRO.UMontreal.CA Tue Sep 8 14:48:04 2009 Received: (at 4368) by emacsbugs.donarmstrong.com; 8 Sep 2009 21:48:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.7 required=4.0 tests=AWL,HAS_BUG_NUMBER, IMPRONONCABLE_2,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n88Lm0H0016192 for <4368@emacsbugs.donarmstrong.com>; Tue, 8 Sep 2009 14:48:01 -0700 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n88Llw8u030749; Tue, 8 Sep 2009 17:47:58 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id F28B23A8F3; Tue, 8 Sep 2009 17:47:57 -0400 (EDT) From: Stefan Monnier To: Tom Tromey Cc: 4368@debbugs.gnu.org Subject: Re: bug#4368: 23.1; diff-hunk-kill -vs- final hunk in a file Message-ID: References: Date: Tue, 08 Sep 2009 17:47:57 -0400 In-Reply-To: (Tom Tromey's message of "Mon, 07 Sep 2009 22:13:27 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3358=0 > I'm using diff-mode to edit a patch. > The patch was generated by "git diff". > I typed M-k to remove the last hunk in a file. > However, it left the "header" around: > diff --git a/src/data.c b/src/data.c > index 7b59673..9063cef 100644 > --- a/src/data.c > +++ b/src/data.c > diff --git a/src/eval.c b/src/eval.c > index 4b7aa32..dbaa385 100644 > --- a/src/eval.c > [...] Can you show the content before the last M-k ? Stefan From tromey@redhat.com Tue Sep 8 19:27:46 2009 Received: (at 4368) by emacsbugs.donarmstrong.com; 9 Sep 2009 02:27:46 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n892Rjtf008723 for <4368@emacsbugs.donarmstrong.com>; Tue, 8 Sep 2009 19:27:46 -0700 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n892RiqH032184; Tue, 8 Sep 2009 22:27:44 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n892Rh1N020822; Tue, 8 Sep 2009 22:27:43 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n892Rg2U017616; Tue, 8 Sep 2009 22:27:42 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id D0EB6378182; Tue, 8 Sep 2009 20:27:41 -0600 (MDT) From: Tom Tromey To: Stefan Monnier Cc: 4368@debbugs.gnu.org Subject: Re: bug#4368: 23.1; diff-hunk-kill -vs- final hunk in a file References: Reply-To: Tom Tromey X-Attribution: Tom Date: Tue, 08 Sep 2009 20:27:41 -0600 In-Reply-To: (Stefan Monnier's message of "Tue, 08 Sep 2009 17:47:57 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Stefan> Can you show the content before the last M-k ? The appended is a sample diff. I just grabbed a couple random hunks from the actual diff I was editing. It was originally made by git. Put it in a file, then M-x diff-mode. M-n to go to the first @@. M-k. You will see that all the header info from lisp.h remains in the buffer. I don't think you even need the second file diff in there to see this, a single file will do. Tom diff --git a/src/lisp.h b/src/lisp.h index 4807794..c619bcf 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1545,6 +1519,7 @@ typedef struct { #define SUB_CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_SUB_CHAR_TABLE) #define BOOL_VECTOR_P(x) PSEUDOVECTORP (x, PVEC_BOOL_VECTOR) #define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME) +#define THREADP(x) PSEUDOVECTORP (x, PVEC_THREAD) /* Test for image (image . spec) */ #define IMAGEP(x) (CONSP (x) && EQ (XCAR (x), Qimage)) diff --git a/src/window.c b/src/window.c index 1b2305d..283dcff 100644 --- a/src/window.c +++ b/src/window.c @@ -5898,7 +5898,7 @@ struct save_window_data struct Lisp_Vector *next_from_Lisp_Vector_struct; Lisp_Object selected_frame; Lisp_Object current_window; - Lisp_Object current_buffer; + Lisp_Object m_current_buffer; Lisp_Object minibuf_scroll_window; Lisp_Object minibuf_selected_window; Lisp_Object root_window; From monnier@iro.umontreal.ca Wed Sep 9 07:49:36 2009 Received: (at 4368-done) by emacsbugs.donarmstrong.com; 9 Sep 2009 14:49:36 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n89EnZFx009074 for <4368-done@emacsbugs.donarmstrong.com>; Wed, 9 Sep 2009 07:49:36 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq4EAP9cp0pFpZBe/2dsb2JhbACBU91EhBgFh20 X-IronPort-AV: E=Sophos;i="4.44,358,1249272000"; d="scan'208";a="45452284" Received: from 69-165-144-94.dsl.teksavvy.com (HELO pastel.home) ([69.165.144.94]) by ironport2-out.teksavvy.com with ESMTP; 09 Sep 2009 10:48:02 -0400 Received: by pastel.home (Postfix, from userid 20848) id 8AF8E9410; Wed, 9 Sep 2009 10:49:29 -0400 (EDT) From: Stefan Monnier To: Tom Tromey Subject: Re: bug#4368: 23.1; diff-hunk-kill -vs- final hunk in a file Message-ID: References: Date: Wed, 09 Sep 2009 10:49:29 -0400 In-Reply-To: (Tom Tromey's message of "Tue, 08 Sep 2009 20:27:41 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Stefan> Can you show the content before the last M-k ? > The appended is a sample diff. I just grabbed a couple random hunks > from the actual diff I was editing. It was originally made by git. > Put it in a file, then M-x diff-mode. > M-n to go to the first @@. > M-k. > You will see that all the header info from lisp.h remains in the buffer. > I don't think you even need the second file diff in there to see this, a > single file will do. Hmm... indeed it fails all the time. Yet, I'm sure it used to work. Anyway, the patch below seems to fix it. Thanks, Stefan Index: lisp/diff-mode.el =================================================================== RCS file: /sources/emacs/emacs/lisp/diff-mode.el,v retrieving revision 1.161 diff -u -r1.161 diff-mode.el --- lisp/diff-mode.el 1 Sep 2009 07:24:18 -0000 1.161 +++ lisp/diff-mode.el 9 Sep 2009 14:47:45 -0000 @@ -546,7 +546,8 @@ (interactive) (diff-beginning-of-hunk) (let* ((start (point)) - (nexthunk (when (re-search-forward diff-hunk-header-re nil t) + ;; Search the second match, since we're looking at the first. + (nexthunk (when (re-search-forward diff-hunk-header-re nil t 2) (match-beginning 0))) (firsthunk (ignore-errors (goto-char start) From unknown Wed Sep 10 19:49:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Oct 2009 14:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator