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 16:20:18 +0100
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt)

Tom wrote:
> Sebastien Vauban <address@hidden> writes:
>
>> Last thing: can you post your complete chunk of code regarding this? I mean
>> with your additional check which calls the automatic highlighting of hunks
>> only if the diff is below a certain size? Thanks a lot...
>
> It's quite straightforward:
>
> (add-hook 'diff-mode-hook 'my-diff-stuff)
>
> (defun my-diff-stuff ()
>   (unless (or (eq this-command 'dvc-diff) ; does not work with DVC
>               (eq this-command 'dvc-generic-refresh)
>               (> (buffer-size) 20000))
>     (my-refine-all-diff-hunks)))
>
> (defun my-refine-all-diff-hunks ()
>   (interactive)
>   (condition-case nil      
>       (save-excursion
>         (goto-char (point-min))
>         (while (not (eobp))
>           (diff-hunk-next)))
>     (error nil)))

FYI, have a look at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12894.

Best regards,
  Seb

-- 
Sebastien Vauban


reply via email to

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