aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-09-12 05:11:07 +0000
committerStefan Monnier2007-09-12 05:11:07 +0000
commit80a01d975acd7aaaa420458c057f29e46a8dbc8e (patch)
tree901b83171f5af96f90d56cc46140eaaca1c92b14
parent308114ef9f06dd70ad50983a0c2504e064dadd52 (diff)
downloademacs-80a01d975acd7aaaa420458c057f29e46a8dbc8e.tar.gz
emacs-80a01d975acd7aaaa420458c057f29e46a8dbc8e.zip
(diff-sanity-check-hunk): Fix up the case when unified
diffs are concatenated with no intervening line.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/diff-mode.el11
2 files changed, 15 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c3d8fd8b92d..058a355a929 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * diff-mode.el (diff-sanity-check-hunk): Fix up the case when unified
4 diffs are concatenated with no intervening line.
5
12007-09-10 Dave Love <fx@gnu.org> 62007-09-10 Dave Love <fx@gnu.org>
2 7
3 * progmodes/python.el: Merge changes from Dave Love's v2007-Sep-10. 8 * progmodes/python.el: Merge changes from Dave Love's v2007-Sep-10.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 7cd7375ab98..ab12c6133f2 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -1181,7 +1181,16 @@ Only works for unified diffs."
1181 (while 1181 (while
1182 (case (char-after) 1182 (case (char-after)
1183 (?\s (decf before) (decf after) t) 1183 (?\s (decf before) (decf after) t)
1184 (?- (decf before) t) 1184 (?-
1185 (if (and (looking-at diff-file-header-re)
1186 (zerop before) (zerop after))
1187 ;; No need to query: this is a case where two patches
1188 ;; are concatenated and only counting the lines will
1189 ;; give the right result. Let's just add an empty
1190 ;; line so that our code which doesn't count lines
1191 ;; will not get confused.
1192 (progn (save-excursion (insert "\n")) nil)
1193 (decf before) t))
1185 (?+ (decf after) t) 1194 (?+ (decf after) t)
1186 (t 1195 (t
1187 (cond 1196 (cond