help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Diff could also show the changes within lines


From: Sebastien Vauban
Subject: Re: Diff could also show the changes within lines
Date: Thu, 15 Nov 2012 11:04:52 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt)

Hi Tom,

Tom wrote:
> Sebastien Vauban <wxhgmqzgwmuf@...> writes:
>>> Does it highlight all the hunks then?
>>
>> No, it doesn't, as you can see on http://screencast.com/t/5NHwKwF7c9h.
>>
>> What does that mean, then -- excepting that it looks coherent with what is 
>> put
>> in the hook?
>
> The diff highlighting function simply calls a builtin feature repeatedly:
>
>         (goto-char (point-min))
>         (while (not (eobp))
>           (diff-hunk-next)))
>
> diff-hunk-next is bound to TAB, so you can try going to the diff buffer, go
> to the beginning of the buffer and start pressing TAB.
>
> Every TAB press should jump to the next hunk and highlight the diffs within
> lines in that hunk. It is done by default.

Going to the beginning of the diff buffer and hitting TAB, does indeed moves
over every hunk, in turn, and refines the differences at the same time.

> Here's the relevant code from diff-mode.el:
>
> ;; Define diff-{hunk,file}-{prev,next}
> (easy-mmode-define-navigation
>  diff-hunk diff-hunk-header-re "hunk" diff-end-of-hunk diff-restrict-view
>  (if diff-auto-refine-mode
>      (condition-case-unless-debug nil (diff-refine-hunk) (error nil))))
>
> The last two lines show that if diff-auto-refine-mode is t (which is by
> default) then it should do the highlighting. If it doesn't the you may want
> to ask the emacs developers about it.

The variable diff-auto-refine-mode is as well t on my side. But... that does
not help.

BTW, how do you explain that your cursor is not at the end of the buffer, in
your case, after the refine process?

Best regards,
Seb

--
Sebastien Vauban


reply via email to

[Prev in Thread] Current Thread [Next in Thread]