I need to display word-diffs of a number of small strings.
That is, I have a list of pairs similar to the following:
"aaa bbb ccc" . "aaa vv ccc"
"abcd ef ghkl" . "ghkl"
"a (u -> h)" . "(a -> g) (u -> h)"
In each case I'd like to highlight changed or added text. I can do this with many calls to the diff command, but I'm afraid of the cost.
Are there elisp libraries that I could use for this purpose?
wdiff <(echo "abc def ghi" ) <(echo "abc ghi")
=>abc [-def-] ghi
. But that depends on having wdiff and diffutils installed, which won't help if you're building something for general use on Windows, so I guess you do need an elisp solution.