How to adjust the backlight in emacs diff mode?

I am using mercurial.el mode with Emacs. When I run vc-diff , I see diff, but, unlike the source code, it does not stand out well:

Emacs vc-diff

Reading such differences is difficult. How to set up Emacs,

  • highlight lines - and + with different colors? (e.g. red and blue)
  • to highlight word differences (e.g. BitBucket and GitHub)
+6
version-control diff emacs syntax-highlighting
source share
1 answer

Try using Mx ediff-revision , which executes ediff instead of the usual diff. This will give you the word difference and side by side (or top / bottom) display. Check out the editing guide .

The Emacs wiki also has several modes for regular diff files (like what you are looking at) - check this out .

To just change the colors in diff-mode that you are currently using, you can do something like:

 (defun update-diff-colors () "update the colors for diff faces" (set-face-attribute 'diff-added nil :foreground "white" :background "blue") (set-face-attribute 'diff-removed nil :foreground "white" :background "red3") (set-face-attribute 'diff-changed nil :foreground "white" :background "purple")) (eval-after-load "diff-mode" '(update-diff-colors)) 
+13
source share

All Articles