Emacs Save and Quit

As technology has progressed over the years, so have the numerous tools that come along with it. One such tool that has seen a huge change are text editors. Due to their lightweight nature and strong out-of-the-box performance, text editors are in high demand among developers.

Developers must work with large sets of data for long hours, and it is therefore necessary to choose a text editor that provides the best performance.

One such amazing text editor is Emacs, which, due to its simplistic nature and versatility, has made quite a name for itself in the industry. Emacs is known for its immaculate performance speeds, as well as for possessing an extremely user-friendly interface and fully detailed documentation.

The functionalities of Emacs, such as version control integration, multiple editing modes, and others, gives it quite the edge over its competitors. One such amazing feature that comes along with Emacs is the Save and Quit feature. This article covers how to save data and exit from the Emacs text editor.

Buffer System in Emacs

Emacs contains a feature called buffers, which is what you would call a workspace in other editors. The term “buffer” refers to the contents of some file or directory that you are currently viewing. Whenever you open a file or a directory, the text (or the directory list inside) is held in a buffer. When you hit the keys Ctrl + x followed by Ctrl + f to open a file, Emacs opens the file and sends the contents of the file to a buffer that has the same name as the original file. You can view the list of buffers in Emacs by clicking on Ctrl + x, followed by Ctrl + b.

1) Saving Files in Emacs

As mentioned above, Emacs uses buffers to store the contents of a file. Emacs allows you to save the contents to the current buffers by hitting the keys Ctrl + x followed by Ctrl + s.

Users can also save the current buffer to some other file name by hitting the keys Ctrl + x, followed by Ctrl + w.

2) Exiting Files in Emacs

Emacs uses buffers to store the contents of a file, so there can be multiple buffers open at once. To close a particular buffer, hit the keys Ctrl + x, followed by k, and then enter the buffer name.

To completely close and exit Emacs, hit the keys Ctrl + x, followed by Ctrl + c. It is important to note that this action saves the buffers first, before killing Emacs.


The buffer system allows Emacs to perform tasks in an extremely efficient manner and provides lots of power to users for editing their files. This makes Emacs an extremely wonderful tool to have and work with.

About the author

Zeeman Memon

Hi there! I'm a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.