Showing Diff On Some Buffers

Protesilaos Stavrou has a post with a really nice tip. Almost all Emacsers know about save-some-buffers if only from fat fingering its default binding of Ctrl+x s instead of save buffer bound to Ctrl+x Ctrl+s.

As Prot says, that’s handy but often you’re not sure of whether you should save a particular buffer or not. Fortunately, there’ a command to run a diff against the current buffer and its underlying file. Unfortunately, there’s no default way of calling it in the middle of a save-some-buffers command.

Of course, Prot being Prot, he decided to fix that. It turns out to be pretty simple. You just need to add another entry to the save-some-buffers-action-alist. Take a look at Prot’s post for the details. Even if you use this capability only occasionally, it’s worth adding the minimal code to your init.el to have it available when you need it.

Update [2024-12-12 Thu 13:22]: Added link to post.

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