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 12:30:49 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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)))





reply via email to

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