I just stumbled across another feature of Emacs that is new to me. If you save files by typing C-x s
, then for each dirty buffer Emacs will ask if you want to save it. By answering d
Emacs will present you with a diff of the buffer and the on-disk file. Then you can then answer y
or n
to save the buffer or not. Of course, you can do this at any time by typing M-x diff-buffer-with-file
but the ability to take a diff at the last second before saving the buffer is sometimes useful.
Even better is where I learned this. The twitter feed @ecotd (Emacs Command of the Weekday) presents one of these tidbits every week day. The feed has been inactive recently but today brought this nugget. Follow the link to see all the tweets. There’s a lot of Emacs goodness there.