Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?
You want the command M-x diff-buffer-with-file. See the manual:
diff-buffer-with-file is an interactive autoloaded compiled Lisp function in `diff.el'.
(diff-buffer-with-file &optional BUFFER)
View the differences between BUFFER and its associated file. This requires the external program
diffto be in your
You may also be interested in
highlight-changes-mode which automatically and interactively highlights changes made to the buffer after it was enabled.
ediff-current-file is an interactive autoloaded Lisp function in `ediff.el'. (ediff-current-file) Start ediff between current buffer and its file on disk. This command can be used instead of `revert-buffer'. If there is nothing to revert then this command fails.