summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-02-08 16:00:55 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-02-08 16:00:55 +0000
commit02e3336d0cb244db986f0ef094d9aa577ef0a39a (patch)
tree1733c8382323d3f755410ac4c29c147d833b7c94 /lisp/diff-mode.el
parent1abe3a1e4eb4c83a5f37de38b5cb318c14ef5bda (diff)
downloademacs-02e3336d0cb244db986f0ef094d9aa577ef0a39a.tar.gz
(diff-add-change-log-entries-other-window): Avoid the
splitter in context hunks.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index bf6b5cf4895..6e82b63581a 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -1750,7 +1750,14 @@ I.e. like `add-change-log-entry-other-window' but applied to all hunks."
;; Move to where the changes are,
;; `add-change-log-entry-other-window' works better in
;; that case.
- (re-search-forward "\n[!+-<>]" nil t))
+ (re-search-forward
+ (concat "\n[!+-<>]"
+ ;; If the hunk is a context hunk with an empty first
+ ;; half, recognize the "--- NNN,MMM ----" line
+ "\\(-- [0-9]+\\(,[0-9]+\\)? ----\n"
+ ;; and skip to the next non-context line.
+ "\\( .*\n\\)*[+]\\)?")
+ nil t))
(save-excursion
(add-change-log-entry-other-window)
;; Insert a "." so that the entries created don't get