From 02e3336d0cb244db986f0ef094d9aa577ef0a39a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 8 Feb 2008 16:00:55 +0000 Subject: [PATCH] (diff-add-change-log-entries-other-window): Avoid the splitter in context hunks. --- lisp/ChangeLog | 5 +++++ lisp/diff-mode.el | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f98813d6d37..3e1c40b930c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-02-08 Stefan Monnier + + * diff-mode.el (diff-add-change-log-entries-other-window): Avoid the + splitter in context hunks. + 2008-02-08 Kenichi Handa * international/fontset.el (setup-default-fontset): Fix arabic otf 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 -- 2.11.4.GIT