[Top][All Lists]

[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: Sat, 10 Nov 2012 15:30:04 +0000 (UTC)
User-agent: Loom/3.14 (

Sebastien Vauban <wxhgmqzgwmuf@...> writes:

> I'd like to get that feature as well. However, the above code causes me
> 2 problems:
> - only the last hunk is getting refined, both in VC dir's buffer, or when
>   reading (with Gnus) an email with a patch file in it;

Currently I use this code added to the diff mode hook:

(defun my-refine-all-diff-hunks ()
  (condition-case nil      
        (goto-char (point-min))
        (while (not (eobp))
    (error nil)))

It works well for me, it highlights the changes in all hunks
automatically. I use it only for diffing before checkin.

But. It works only because the VC mercurial implementation calls
the backend synchronously. In case of DVC it doesn't work for
me, because DVC calls the backend asynchronously, so when the diff
hook is run the output is not there yet and I did not find a hook
which is called when the async diff command is finished

You may want to check how the diff output is produced in your use
cases. If it is done asynchronously then the diff hook is not a 
suitable place to call the highlighting code from.

reply via email to

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