Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In Emacs, how do I inspect what has been modified in a buffer (before saving and overwriting the file)?

(In a sense, the requested action is an analog of git status and git add -i showing what has been modified, only the comparison should be done between the buffer contents (in Emacs's memory) and the file on disk.)

Sometime, I forget what has been modified in a buffer, and would like to call a command to remind me.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

M-xdiff-buffer-with-file

I've just found it by looking through files.el where I felt there is such a command:

View the differences between BUFFER and its associated file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.