changeset 79782:8d4fc8948539

(diff-end-of-hunk): Don't match empty lines in unified format.
author Glenn Morris <rgm@gnu.org>
date Tue, 08 Jan 2008 05:19:13 +0000
parents a7efe7a6e6e2
children 780b345f7cef
files lisp/diff-mode.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/diff-mode.el	Tue Jan 08 05:18:09 2008 +0000
+++ b/lisp/diff-mode.el	Tue Jan 08 05:19:13 2008 +0000
@@ -391,9 +391,13 @@
       ;; Especially important for unified (because headers are ambiguous).
       (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context))))))
     (goto-char (match-end 0)))
+  ;; Some versions of diff replace all-blank context lines in unified
+  ;; format with empty lines. The use of \n below avoids matching such
+  ;; lines as headers.
+  ;; http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01990.html
   (let ((end (and (re-search-forward (case style
 				       ;; A `unified' header is ambiguous.
-				       (unified (concat "^[^-+# \\]\\|"
+				       (unified (concat "^[^-+# \\\n]\\|"
 							diff-file-header-re))
 				       (context "^[^-+#! \\]")
 				       (normal "^[^<>#\\]")