Using Ediff On Regions

One of the Emacs powerhouses is Ediff. Every time I think I’ve found a better way of comparing files, it turns out that I just didn’t understand Ediff well enough. It can seem intimidating but as Prot informed me it really pretty simple if you ignore all the complications. I took his advice and can only agree with his assessment.

Now James Dyer has his own take on Ediff. His particular use case is comparing regions rather than whole files. It turns out that there are two functions, ediff-regions-linewise and ediff-regions-wordwise that will use Ediff to compare two regions in the usual Ediff way.

The documentation recommends that you use ediff-regions-wordwise for small regions and ediff-regions-linewise for larger regions. In either case, once you set up the regions to be compared you use Ediff in the usual way. Take a look at Dyer’s post to see how to set up the regions. It’s straightforward and easy to remember once you use it a couple of times.

It’s a nice post and well worth reading even if you don’t need to compare regions right now. You probably will in the future and even if you don’t remember the details, you’ll know what to look for when you do.

This entry was posted in General and tagged . Bookmark the permalink.