changeset 91666:2229d6434820

(diff-add-change-log-entries-other-window): Avoid the splitter in context hunks.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 08 Feb 2008 16:00:55 +0000
parents e123b520c277
children b3e6289494fb
files lisp/ChangeLog lisp/diff-mode.el
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Feb 08 15:39:03 2008 +0000
+++ b/lisp/ChangeLog	Fri Feb 08 16:00:55 2008 +0000
@@ -1,3 +1,8 @@
+2008-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* diff-mode.el (diff-add-change-log-entries-other-window): Avoid the
+	splitter in context hunks.
+
 2008-02-08  Kenichi Handa  <handa@ni.aist.go.jp>
 
 	* international/fontset.el (setup-default-fontset): Fix arabic otf
--- a/lisp/diff-mode.el	Fri Feb 08 15:39:03 2008 +0000
+++ b/lisp/diff-mode.el	Fri Feb 08 16:00:55 2008 +0000
@@ -1750,7 +1750,14 @@
                    ;; 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