From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: diff-mode reports offsets incorrectly Date: Tue, 5 Feb 2008 18:04:20 +1300 Message-ID: <18343.61012.833788.163974@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202187948 3369 80.91.229.12 (5 Feb 2008 05:05:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Feb 2008 05:05:48 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 05 06:06:09 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JMFzf-0005xM-SC for ged-emacs-devel@m.gmane.org; Tue, 05 Feb 2008 06:05:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMFzD-0004hT-GN for ged-emacs-devel@m.gmane.org; Tue, 05 Feb 2008 00:04:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMFz8-0004gw-1O for emacs-devel@gnu.org; Tue, 05 Feb 2008 00:04:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMFz6-0004gR-Q7 for emacs-devel@gnu.org; Tue, 05 Feb 2008 00:04:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMFz6-0004gM-La for emacs-devel@gnu.org; Tue, 05 Feb 2008 00:04:40 -0500 Original-Received: from viper.snap.net.nz ([202.37.101.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMFz6-0004sF-2X for emacs-devel@gnu.org; Tue, 05 Feb 2008 00:04:40 -0500 Original-Received: from kahikatea.snap.net.nz (136.62.255.123.dynamic.snap.net.nz [123.255.62.136]) by viper.snap.net.nz (Postfix) with ESMTP id DEE503D80BD for ; Tue, 5 Feb 2008 18:04:31 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 9651B8FC6D; Tue, 5 Feb 2008 18:04:21 +1300 (NZDT) X-Mailer: VM 7.19 under Emacs 22.1.50.23 X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88233 Archived-At: diff-mode reports offsets if the first hunk replaces code with a different number of lines. Consider the patch below. The first hunk removes four lines and adds one. When the second hunk is applied Emacs reports: Hunk applied at offset 3 lines but this is only because 4 - 1 = 3, and Emacs is presumably looking at the line numbering before the first hunk was applied. This didn't happen in Emacs 21.4, but happens in EMACS_22_BASE and trunk. I don't know about Emacs 22.1 --- breakpoint.c 05 Feb 2008 13:46:40 +1300 *************** print_one_breakpoint_location (struct br *** 3425,3434 **** /* 4 */ annotate_field (3); if (part_of_multiple) ! ui_out_field_string (uiout, "enabled", ! loc->shlib_disabled ! ? (loc->enabled ? "y(p)" : "n(p)") ! : (loc->enabled ? "y" : "n")); else { int pending = (b->loc == NULL || b->loc->shlib_disabled); --- 3425,3431 ---- /* 4 */ annotate_field (3); if (part_of_multiple) ! ui_out_field_string (uiout, "enabled", loc->enabled ? "y" : "n"); else { int pending = (b->loc == NULL || b->loc->shlib_disabled); *************** print_one_breakpoint_location (struct br *** 3436,3446 **** ... -- Nick http://www.inet.net.nz/~nickrob