The question is pretty self-explanatory. When I close emacs and some changes are unsaved, I'm asked if I want to save the file and given this list of options. I assume "y" and "n" are "yes" and "no", but what are the other options?
Use the keyboard shortcut Ctrl+S. Go to File > Save on the Menu bar. Click the Save icon on the Standard toolbar. Using the Save command will overwrite the last saved version of the file.
To save the file you are editing, type C-x C-s or select Save Buffer from the Files menu. Emacs writes the file. To let you know that the file was saved correctly, it puts the message Wrote filename in the minibuffer.
To insert text into a buffer, place the cursor where you want to start inserting text, and start typing away. If you want to insert the contents of another file into the current buffer, place the cursor at the desired insertion point, and type Control-X-I. Emacs will ask you for the name of the file you wish to insert.
Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer.
Type ? and you'll 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);
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.
If you want to add/change actions that happen during the save-some-buffers
function, then you can modify the variable save-some-buffers-action-alist
. Perhaps if you wanted to add a binding to save the changes and kill the buffer via the key k. You could do this:
(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 further directs you to map-y-or-n-p
- which actually does have documentation on the format of that variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With