Emacs Elements On Using Ediff

Emacs Elements has posted another useful short video. This time it’s about an easy way to use ediff. The first thing he mentions is that you can mark two files in dired and they will be used as the default when you call ediff.

That’s good to know. Then he mentions a complaint. When you quit ediff the buffers for the two files remain selected and visible. The majority of the video demonstrates his solution to this. His final workflow starts in dired. You mark the two files you want to compare and simply press = to invoke ediff. When you’re done and quit ediff, your window configuration is restored to what it was before.

It seems like a worthwhile customization, especially if your main use case is just comparing two files. He has a link to the code he used so you can copy and paste if you’re interested. My only criticism is that he saves the window configuration in register b. That’s fine until you already have the b register in use. Long ago, I learned a trick from Magnar Sveen to deal with this. When you’re writing Elisp code, there’s no reason to restrict yourself to the usual single character names. You can name it whatever you like. That’s because the register code uses symbols as the names for registers. See my original post on this for the details.

In any event, if you’d like to slightly simplify your ediff use, take a look at the video. It’s only 2 minutes and 6 seconds so there should be no problem finding time for it.

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