]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/diff-mode.el
Merge from emacs-23
[gnu-emacs] / lisp / vc / diff-mode.el
index cec4fb24616c59d062e83ee0ccd154f44cc744d6..c16c2460e75ef65fec3d5ad17efa975aabf2435a 100644 (file)
@@ -1829,10 +1829,13 @@ For use in `add-log-current-defun-function'."
   (eval-and-compile (require 'smerge-mode))
   (save-excursion
     (diff-beginning-of-hunk 'try-harder)
-    (let* ((style (diff-hunk-style))    ;Skips the hunk header as well.
+    (let* ((start (point))
+           (style (diff-hunk-style))    ;Skips the hunk header as well.
            (beg (point))
            (props '((diff-mode . fine) (face diff-refine-change)))
-           (end (progn (diff-end-of-hunk) (point))))
+           ;; Be careful to go back to `start' so diff-end-of-hunk gets
+           ;; to read the hunk header's line info.
+           (end (progn (goto-char start) (diff-end-of-hunk) (point))))
 
       (remove-overlays beg end 'diff-mode 'fine)