这个问题非常明显。当我关闭emacs并且一些更改未保存时,我被问到是否要保存文件并给出这个选项列表。我假设“y”和“n”是“是”和“否”,但其他选项是什么?
答案 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那个变量。