What each of them stands after "Save the file?" prompt: (y, n,!,., q, Cr, d or Ch)

The question is pretty clear. When I close emacs and some changes are unsaved, they ask me if I want to save the file and this list of options. I assume y and n are yes and no, but what are the other options?

+4
source share
1 answer

Enter ? and you will get a buffer showing:

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); Cg to quit (cancel the whole command); ! to save all remaining buffers; Cr to view this buffer; d to view changes in this buffer; or . (period) to save the current buffer and exit. 

If you want to add / change actions that occur during the save-some-buffers function, you can change the save-some-buffers-action-alist variable. Perhaps if you want to add a binding to save changes and destroy the buffer with the k key. You can do it:

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

If you look at the documentation for save-some-buffers , it will direct you to save-some-buffers-action-alist - which then directs you to map-y-or-np - actually has documentation in the format of this variable.

+11
source

Source: https://habr.com/ru/post/1346328/


All Articles