[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ediff: compare two (long) buffers Word-by-word

From: Yuri Khan
Subject: Re: Ediff: compare two (long) buffers Word-by-word
Date: Sun, 25 Nov 2018 16:17:08 +0700

On Sun, Nov 25, 2018 at 4:02 AM ST <> wrote:

> I use Emacs 26.1 and try to compare two (long) buffers (opened side by
> side) by clicking Tools -> Compare (Ediff) -> Windows Word-by-word...
> Then I choose both Windows (A and B) by clicking on each opened buffer.
> However it looks like Emacs compares only the visible parts of the two
> buffers, not the whole buffers. Why?
> I saw there is a command `ediff-windows-wordwise`... How is "Window"
> defined? - as "currently visible part of a buffer"? If yes, is there
> something like `ediff-buffers-wordwise`?

‘ediff-windows-wordwise’ calls ‘ediff-windows’ which calls
‘ediff-regions-internal’, passing to it the two chosen windows and
their respective visible parts. ‘ediff-windows-linewise’ behaves the
same way.

This is not documented in their docstrings nor in Info. Moreover,
(info "(ediff) Major Entry Points") contains the following wording:

> The commands ‘ediff-windows-wordwise’
> and ‘ediff-regions-wordwise’ are intended for relatively small segments
> of buffers (e.g., up to 100 lines, depending on the speed of your
> machine)

which suggests that ‘ediff-windows-*’ should work for 100-line
fragments, and that will only fit in a visible part of a window with a
very small font.

There is no command ‘ediff-buffers-wordwise’; maybe this is because of
performance concerns. You can compare buffers using
‘ediff-regions-wordwise’; after you specify two buffers, it will ask
you to select a region and press C-M-c to proceed, in each buffer.

> I have `git` in `exec-path`, so maybe I can make ediff to display the
> output of `git diff --word-diff file1 file2` in ediff style?

There are customizable variables ‘ediff-diff-program’ and
‘ediff-diff-options’, but I do not know what happens if you plug ‘git’
and ‘diff --no-index --word-diff’ there.

You should also try refinement. After starting Ediff linewise,
navigate to a diff region (‘n’ in the Ediff control window) and press
‘*’. Ediff will highlight word differences in place.

reply via email to

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