GNU bug report logs -
#1537
diff-mode for git patches trouble
Previous Next
Reported by: Dmitriy Blinov <bda <at> mns.spb.ru>
Date: Thu, 11 Dec 2008 13:15:02 UTC
Severity: wishlist
Merged with 1536
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> The last but one line is two minuses by default. And diff-mode
> recognizes first minus as deleted string. Therefore when we change
> some strings in patch, emacs creates malformed hunk offset. It will
> be @@ -6,8 +6,7 @@ insead of correct @@ -6,7 +6,7 @@ after patch
> edition (if we don't delete/create strings).
> Is it possible to fix this harm or I should append whitespace before "--"
> string always?
Given the way the code is currently implemented, it's difficult to fix
this problem. One of the problem is that we currently don't do anything
special before the user modifies the buffer. Not even in
a before-change-function. So by the time we try to update the hunk
header, the buffer has been modified and we don't know what it looked
like before.
I.e. to fix it we'll need to mark the end-of-hunk before the buffer is
really modified. E.g. by automatically adding an empty line at
end-of-hunk (or a marker).
Of course, in the general case the problem is insoluble (e.g. if you
edit the line with the "--"), but clearly we can do better in the
"normal" case.
Stefan
This bug report was last modified 4 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.