bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#17522: diff-mode frustrates attempt to correct corrupted diff file.


From: Stefan Monnier
Subject: bug#17522: diff-mode frustrates attempt to correct corrupted diff file.
Date: Sun, 25 May 2014 16:18:09 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> diff-mode.el was partly changed to accommodate that looser format, but
>> not 100%.
> Why not?

The usual: lack of time/motivation/...

> If you're going to carry on making surreptitious changes to
> hunk headers, you'll need to determine the start and end of hunks
> reliably, especially corrupted hunks.  This can't be done with 100%
> certainty, and is going to involve heuristics.  A good way might be to
> scan a hunk _forwards_ counting lines before the first change to that
> hunk.

Exactly, with a before-change-function.

And if the hunk is found to be borked, then try to at least not make
things worse (and maybe suggest the use of diff-sanity-check-hunk, after
we make it into a command).


        Stefan





reply via email to

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