]> git.eshelyaron.com Git - emacs.git/commitdiff
(diff-end-of-hunk): Don't match empty lines in unified format.
authorGlenn Morris <rgm@gnu.org>
Tue, 8 Jan 2008 05:17:47 +0000 (05:17 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 8 Jan 2008 05:17:47 +0000 (05:17 +0000)
lisp/ChangeLog
lisp/diff-mode.el

index 21205e3f8b1b541c38a4b5caf832db088d0d7e12..a0825f7944140269109a2e8b59934b165267aec3 100644 (file)
@@ -1,5 +1,8 @@
 2008-01-08  Glenn Morris  <rgm@gnu.org>
 
+       * diff-mode.el (diff-end-of-hunk): Don't match empty lines in
+       unified format.
+
        * mouse.el (mouse-major-mode-menu): Suppress duplicate menus.
 
 2008-01-08  Ralf Angeli  <angeli@caeruleus.net>
index 9e9eb81797abe8c08f656a861609d87c0ab9306c..6291453ba1764ad53fc5a0ca435c0acb410078fe 100644 (file)
@@ -1,7 +1,7 @@
 ;;; diff-mode.el --- a mode for viewing/editing context diffs
 
 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: convenience patch diff
@@ -401,9 +401,13 @@ when editing big diffs)."
 (defun diff-end-of-hunk (&optional style)
   ;; Especially important for unified (because headers are ambiguous).
   (setq style (diff-hunk-style style))
+  ;; 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 "^[^<>#\\]")