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: Tom
Subject: Re: Diff could also show the changes within lines
Date: Thu, 15 Nov 2012 06:36:45 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sebastien Vauban <address@hidden> 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.

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.






reply via email to

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