20

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

  • 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
9
(setq-default ediff-forward-word-function 'forward-char)
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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.