summaryrefslogtreecommitdiff
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-04-16 21:52:14 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-04-16 21:52:14 +0000
commit996884b257d62b98d3e4438848a510e19eaf021a (patch)
tree014d1c182419cbd964f2725452973644bd9f1136 /lisp/diff-mode.el
parenta1bfe073ea1774b5f14b77b37a08ebb7e1f23c90 (diff)
downloademacs-996884b257d62b98d3e4438848a510e19eaf021a.tar.gz
(diff-end-of-hunk): Be more careful with unified hunks.
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el6
1 files changed, 5 insertions, 1 deletions
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 "^[^-+# \\]\\|"