Here is the recipe. C-x C-f comment.el RET M < M q C-x C-s M q M-x diff-buffer-with-file RET C-x C-f comment.el RET Here is what the diff produces. When there are no differences, why is the buffer marked as modified? --8<---------------cut here---------------start------------->8--- diff -pub --label /home/kjambunathan/comment.el --label \#\ /home/kjambunathan/comment.el /tmp/buffer-content-2444dnM Diff finished (no differences). Thu Oct 31 22:45:13 2013 --8<---------------cut here---------------end--------------->8---