emacs-devel
[Top][All Lists]
Advanced

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

Re: diff-sanity-check-hunk fails on "unterminated" hunks


From: Bob Rogers
Subject: Re: diff-sanity-check-hunk fails on "unterminated" hunks
Date: Wed, 12 Sep 2007 08:09:25 -0400

   From: Stefan Monnier <address@hidden>
   Date: Wed, 12 Sep 2007 01:09:38 -0400

   > to get all differing files at once (as any reasonable person would), I
   > produced the diffs separately and concatenated them:

   Yes, these diffs are problematic because you need to count the lines in
   order to do the right thing and most of diff-mode.el doesn't count the lines
   but just presumes that the hunk-end will be self-evident.

But the hunk-extracting code (e.g. for C-c C-c) does seem to work with
such hunks, once diff-sanity-check-hunk is taught not to complain . . .

   . . .

   Does the patch below address your particular problem (which I agree is
   a case that should be handled, I've encountered it several times already,
   tho that was before implementing diff-sanity-check-hunk, obviously).

           Stefan

This looks like it ought to work, and does seem more robust; I will test
it later today (no time now).  But I'm a bit concerned about the effect
of silently adding a newline; this will fail mysteriously if the diff is
read-only.

                                        -- Bob




reply via email to

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