emacs - 突出显示缓冲区修改

标签 emacs

经常发生文件缓冲区被修改(duh!)。在退出之前,emacs 会询问是否保存更改。现在知道实际发生了什么变化会很有趣。有没有办法找出来?

最佳答案

从 Emacs 22.1(至少)开始,'save-buffers-kill-emacs (C-x C-c 的默认绑定(bind))提示您输入每个具有文件的未保存缓冲区。当提示保存并查看差异时,键入 d。

从帮助文档中:

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.

关于emacs - 突出显示缓冲区修改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/626492/

相关文章:

emacs - 如何删除 Emacs 中的当前行?

Mac 上的 Emacs 初学者工具包

emacs - 将 Emacs 缓冲区固定到 Windows(用于 cscope)

emacs - 在 Emacs 中查找/突出显示两个缓冲区之间的公共(public)子字符串

emacs - 如何转义双引号?

emacs - Emacs包含一个函数来递归遍历目录结构并调用一个函数吗?

c++ - Emacs shell 与带有 GCC 的终端有不同的行为

scala - Emacs 上的 Scaml 语法高亮显示

emacs - 在开发基于 compojure/ring 的应用程序时使用 emacs/cider 的正确方法是什么?

emacs - 为什么 Emacs 项目 C-c p 未定义?