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: Fri, 16 Nov 2012 16:24:38 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sebastien Vauban <address@hidden> writes:

> 
> Yep!  This does work perfectly: all hunks refined, and pointer at beginning of
> buffer...
> 
> Thanks a lot for your more than precious help!
> 

No problem. I'll also need it when I upgrade emacs, so I helped
my future self as well. :)


BTW, highlighting within the lines is helpful in most of the cases, but
sometimes when the diff is very convoluted it can get in the way. To remedy
this I added a key (f7) which when pressed in the diff buffer toggles
the in-line highlight on and off.

I put it here in case someone else also finds it useful:



(add-hook 'diff-mode-hook 'my-diff-stuff)

(setq my-diff-refine-change-color "yellow1")

(defun my-toggle-diff-refine-change-color()
  (interactive)
  (if (face-background 'diff-refine-change)
      (set-face-background 'diff-refine-change nil)
    (set-face-background 'diff-refine-change my-diff-refine-change-color)))


(defun my-diff-stuff ()
  (set-face-background 'diff-refine-change my-diff-refine-change-color)
  (local-set-key (kbd "<f7>") 'my-toggle-diff-refine-change-color)

  (unless (or (eq this-command 'dvc-diff)
              (eq this-command 'dvc-generic-refresh)
              (> (buffer-size) 20000))
    (my-refine-all-diff-hunks)))





reply via email to

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