27

When two buffers are compared for differences, M-x ediff-buffers does not indicate the specific characters that have changed within a word (ie "character-level" diffs). Most modern diff tools will show the diffs within a word.

Emacs seems to be missing this important (or obviously useful?) feature by default. How can I make Emacs display the diffs by character?

Update Here's M-x ediff-buffers diff1 diff2, using emacs -Q to ensure that my theme is not interferring: enter image description here

Here's the same text pasted into Meld: enter image description here

modulitos
  • 2,432
  • 1
  • 18
  • 36
  • It looks like this problem is related to the theme you're using. In vanilla Emacs (24.4), differences between individual lines are highlighted. You can verify this by starting Emacs via `emacs -Q` and calling `ediff-buffers` on `diff1` and `diff2` as you normally would. – itsjeyd Jan 14 '15 at 11:35
  • I tried running with `emacs -Q`, added above. Also, I modified my question to address *character-level* diffs instead of *intra-line* diffs. – modulitos Jan 14 '15 at 13:29

2 Answers2

16
(setq-default ediff-forward-word-function 'forward-char)
Joakim Hårsman
  • 719
  • 5
  • 11
6

This feature is called "refining" in Ediff. You can hit * to refine the current hunk, or @ to turn on automatic refining whenever you move to a different hunk.

legoscia
  • 6,012
  • 29
  • 54
  • 1
    I modified my question to address the *character-level* diffs instead of the *intra-line* diffs. Is it possible to make Emacs show the diffs within a word? – modulitos Jan 14 '15 at 13:28