You can use ediff-regions-wordwise
for the whole buffers.
The input of the regions is a bit daunting though.
The following elisp snippet defines ediff-buffers-wordwise
working like ediff-buffers
. A caveat is that it uses the internal function ediff-regions-internal
. So it might be that it does not work with future emacs versions. But that is not very likely.
You can copy the elisp snippet to your init file if you want to use it.
ediff-buffers-wordwise
is available after the next restart of Emacs or after reevaluating the init file.
(eval `(defun ediff-buffers-wordwise (buffer-A buffer-B &optional startup-hooks job-name)
,(concat (documentation 'ediff-buffers) "\nComparison is done word-wise.")
,(interactive-form 'ediff-buffers)
(setq bufA (get-buffer buffer-A)
bufB (get-buffer buffer-B)
job-name (or job-name 'ediff-buffers-wordwise))
(cl-assert bufA nil
"Not a live buffer: %s" buffer-A)
(cl-assert bufB nil
"Not a live buffer: %s" buffer-B)
(ediff-regions-internal bufA
(with-current-buffer bufA
(point-min))
(with-current-buffer bufA
(point-max))
bufB
(with-current-buffer bufB
(point-min))
(with-current-buffer bufB
(point-max))
startup-hooks
job-name
'word-mode
nil)))
(require 'easymenu)
(easy-menu-add-item
menu-bar-tools-menu
'("Compare (Ediff)")
["Two Buffers Word-by-word..." ediff-buffers-wordwise t]
"Three Files...")