在“保存文件”之后,每个都代表什么?提示:(y,n,!,。,q,C-r,d或C-h)

时间:2011-04-02 00:44:22

标签: emacs

这个问题非常明显。当我关闭emacs并且一些更改未保存时,我被问到是否要保存文件并给出这个选项列表。我假设“y”和“n”是“是”和“否”,但其他选项是什么?

1 个答案:

答案 0 :(得分:13)

输入,你会得到一个显示缓冲区的信息:

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.

如果要添加/更改save-some-buffers功能期间发生的操作,则可以修改变量save-some-buffers-action-alist。也许如果你想添加一个绑定来保存更改并通过键 k 杀死缓冲区。你可以这样做:

(add-to-list 'save-some-buffers-action-alist
             `(?k ,(lambda (buf) (save-buffer buf) (kill-buffer buf))
                  ,(purecopy "save changes and kill the buffer")))

如果您查看save-some-buffers的文档,它会引导您转到save-some-buffers-action-alist - 这会进一步引导您map-y-or-n-p - 实际上格式为documentation那个变量。