From: Stefan Monnier Date: Fri, 16 Apr 2004 21:52:14 +0000 (+0000) Subject: (diff-end-of-hunk): Be more careful with unified hunks. X-Git-Tag: ttn-vms-21-2-B4~6784 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=996884b257d62b98d3e4438848a510e19eaf021a;p=emacs.git (diff-end-of-hunk): Be more careful with unified hunks. --- diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f6b2520a112..d41bfcad58a 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -305,7 +305,11 @@ when editing big diffs)." (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 "^[^-+# \\]\\|"