经常发生修改文件缓冲区(呃!).退出之前,emacs会询问是否保存更改.现在知道实际改变了什么会很有趣.有没有办法找出来?
从Emacs 22.1开始(至少),'save-buffers-kill-emacs
(默认绑定C-x C-c)会提示您输入每个具有文件的未保存缓冲区.d在提示保存时输入a 并查看差异.
从帮助文档:
Save some modified file-visiting buffers. Asks user about each one. You can answer `y' to save, `n' not to save, `C-r' to look at the buffer in question with `view-buffer' before deciding or `d' to view the differences using `diff-buffer-with-file'.
如果你看一下提示,它应该说:
Save file /path/to/file.txt? (y, n, !, ., q, C-r, d, or C-h)
打字C-h会给你一些更详细的描述(但d你要求的是):
Type SPC or `y' to save the current buffer; DEL or `n' to skip the current buffer; RET or `q' to give up on the save (skip all remaining buffers); C-g to quit (cancel the whole command); ! to save all remaining buffers; C-r to view this buffer; d to view changes in this buffer; or . (period) to save the current buffer and exit.
我使用diff-buffer-with-file,并选择缓冲区来自的文件(这是命令的默认值...只需按Enter键).
您也可以使用突出显示更改模式,但在开启之前不会跟踪更改,因此如果您想要查看关闭未处于此模式的文件时发生的更改,则不太有用: - )
你可以highlight-changes-mode
启用.它将以红色显示所有变化.但是,它不会显示空格更改,并且仅使用红色标记删除_
.另见http://www.emacswiki.org/emacs/TrackChanges.