# HG changeset patch # User Stefan Monnier # Date 1082152334 0 # Node ID 28a55e2ec30f7e82f60516973e71de8b6d70b427 # Parent 7b6b4d9ae7268f10ae925d897136b1d4e525b6bb (diff-end-of-hunk): Be more careful with unified hunks. diff -r 7b6b4d9ae726 -r 28a55e2ec30f lisp/diff-mode.el --- a/lisp/diff-mode.el Fri Apr 16 21:19:16 2004 +0000 +++ b/lisp/diff-mode.el Fri Apr 16 21:52:14 2004 +0000 @@ -305,7 +305,11 @@ (defvar diff-narrowed-to nil) (defun diff-end-of-hunk (&optional style) - (if (looking-at diff-hunk-header-re) (goto-char (match-end 0))) + (when (looking-at diff-hunk-header-re) + (unless style + ;; Especially important for unified (because headers are ambiguous). + (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context)))))) + (goto-char (match-end 0))) (let ((end (and (re-search-forward (case style ;; A `unified' header is ambiguous. (unified (concat "^[^-+# \\]\\|"