all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: emacs-devel@gnu.org
Subject: Re: diff-mode reports offsets incorrectly
Date: Tue, 05 Feb 2008 11:08:42 -0500	[thread overview]
Message-ID: <jwvodavl74x.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <18343.61012.833788.163974@kahikatea.snap.net.nz> (Nick Roberts's message of "Tue, 5 Feb 2008 18:04:20 +1300")

> 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

Are you sure this changed?  I can't remember changing anything in
this area.  Not that it's terribly important since hunk can be applied
in any order (and don't need to all be applied), so offsets are
a completely normal occurrence.


        Stefan


> --- 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





  reply	other threads:[~2008-02-05 16:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05  5:04 diff-mode reports offsets incorrectly Nick Roberts
2008-02-05 16:08 ` Stefan Monnier [this message]
2008-02-05 21:03   ` Nick Roberts
2008-02-05 22:23     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvodavl74x.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.