emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff-mode reports offsets incorrectly


From: Stefan Monnier
Subject: Re: diff-mode reports offsets incorrectly
Date: Tue, 05 Feb 2008 11:08:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]