diff options
| author | Stefan Monnier | 2007-09-12 05:11:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-09-12 05:11:07 +0000 |
| commit | 80a01d975acd7aaaa420458c057f29e46a8dbc8e (patch) | |
| tree | 901b83171f5af96f90d56cc46140eaaca1c92b14 /lisp/diff-mode.el | |
| parent | 308114ef9f06dd70ad50983a0c2504e064dadd52 (diff) | |
| download | emacs-80a01d975acd7aaaa420458c057f29e46a8dbc8e.tar.gz emacs-80a01d975acd7aaaa420458c057f29e46a8dbc8e.zip | |
(diff-sanity-check-hunk): Fix up the case when unified
diffs are concatenated with no intervening line.
Diffstat (limited to 'lisp/diff-mode.el')
| -rw-r--r-- | lisp/diff-mode.el | 11 |
1 files changed, 10 insertions, 1 deletions
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 |