7.7 Refinement of Difference Regions

Ediff has variables to control the way fine differences are highlighted. This feature gives you control over the process of refinement. Note that refinement ignores spaces, tabs, and newlines.


This variable controls whether fine differences within regions are highlighted automatically (“auto-refining”). The default is yes (‘on’).

On a slow machine, automatic refinement may be painful. In that case, you can turn auto-refining on or off interactively by typing @. You can also turn off display of refining that has already been done.

When auto-refining is off, fine differences are shown only for regions for which these differences have been computed and saved before. If auto-refining and display of refining are both turned off, fine differences are not shown at all.

Typing * computes and displays fine differences for the current difference region, regardless of whether auto-refining is turned on.


If auto-refining is on, this variable limits the size of the regions to be auto-refined. This guards against the possible slowdown that may be caused by extraordinary large difference regions.

You can always refine the current region by typing *.


This variable controls how fine differences are computed. The value must be a Lisp function that determines how the current difference region should be split into words.

Fine differences are computed by first splitting the current difference region into words and then passing the result to ediff-diff-program. For the default forward word function (which is ediff-forward-word), a word is a string consisting of letters, ‘-’, or ‘_’; a string of punctuation symbols; a string of digits, or a string consisting of symbols that are neither space, nor a letter.

This default behavior is controlled by four variables: ediff-word-1, ..., ediff-word-4. See the on-line documentation for these variables and for the function ediff-forward-word for an explanation of how to modify these variables.

Sometimes, when a region has too many differences between the variants, highlighting of fine differences is inconvenient, especially on color displays. If that is the case, type * with a negative prefix argument. This unhighlights fine differences for the current region.

To unhighlight fine differences in all difference regions, use the command @. Repeated typing of this key cycles through three different states: auto-refining, no-auto-refining, and no-highlighting of fine differences.