# HG changeset patch # User Glenn Morris # Date 1199769434 0 # Node ID 706ecd592fcef517d257863575a21960562d98d1 # Parent 454ba5d2d3acd034d936db826807d09f13820e44 (diff-end-of-hunk): Don't match empty lines in unified format. diff -r 454ba5d2d3ac -r 706ecd592fce lisp/diff-mode.el --- a/lisp/diff-mode.el Tue Jan 08 05:13:06 2008 +0000 +++ b/lisp/diff-mode.el Tue Jan 08 05:17:14 2008 +0000 @@ -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 ;; Keywords: convenience patch diff @@ -401,9 +401,13 @@ (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 "^[^<>#\\]")