Learning GNU Emacs, 3rd Edition
by Debra Cameron, James Elliott, Marc Loy, Eric S. Raymond, Bill Rosenblatt
More About Buffers
In this section, we'll learn about saving multiple buffers, renaming buffers, read-only buffers, and operations you can do with the buffer list—not only a useful tool but a good introduction to the principles you'll encounter in the directory editor, Dired, covered in Chapter 5.
Saving Multiple Buffers
You know about saving buffers individually by typing C-x C-s. Once you're using multiple buffers, you should also know that you can save them all at once by typing C-x s (for save-some-buffers). Emacs asks you if you want to save each buffer that is connected with a file (it doesn't offer to save new buffers you've created but have not associated with a file and, of course, it doesn't save its own internal buffers). For each buffer, you can answer y to save it or n not to. You can also type ! to save all the buffers without asking. If you want to save this buffer and no more, type a period (.). If you want to cancel the command and not save the current buffer, press q (of course, any buffers you saved before pressing q are already saved; q does not undo those). You may want to look at the buffer before deciding whether to save it; if so, type C-r. Emacs enters view mode, allowing you to look at the buffer but not make changes. Press q to exit view mode and continue saving buffers.
Renaming Buffers
When you are editing a file, the buffer takes on the name of the file. If you have long filenames, you may find it convenient to rename buffers to shorter names (this ...