# HG changeset patch # User Stefan Monnier # Date 1291751295 18000 # Node ID 99a401ad0d45180048a32ae53ec8ac48b5b2ca7c # Parent e71e87e08d5f2b5e1709fbf8bd6190a42c8f5203 * diff-mode.el (diff-refine-hunk): Make it work when the hunk contains empty lines without a leading space. diff -r e71e87e08d5f -r 99a401ad0d45 lisp/ChangeLog --- a/lisp/ChangeLog Tue Dec 07 14:44:38 2010 -0500 +++ b/lisp/ChangeLog Tue Dec 07 14:48:15 2010 -0500 @@ -1,3 +1,8 @@ +2010-12-07 Stefan Monnier + + * diff-mode.el (diff-refine-hunk): Make it work when the hunk contains + empty lines without a leading space. + 2010-12-06 Leo * dired-aux.el (dired-do-redisplay): Postphone diff -r e71e87e08d5f -r 99a401ad0d45 lisp/diff-mode.el --- a/lisp/diff-mode.el Tue Dec 07 14:44:38 2010 -0500 +++ b/lisp/diff-mode.el Tue Dec 07 14:48:15 2010 -0500 @@ -1827,10 +1827,13 @@ (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)