Emacs uses the built-in desktop library to save and restore sessions across restarts. The saved session includes open buffers, their file names, major modes, window layouts, and buffer positions. GNU.org +1Enabling Automatic Session Saving To automatically save and restore your sessions, you can add the following line to your Emacs initialization file (usually ~/.emacs or ~/.emacs.d/init.el): li..