Emacs-Elements has a short video that describes three useful packages that save various pieces of Emacs state. The three packages are:
The first, real-auto-save
, saves the file you’re working on when Emacs is idle for a configurable number of seconds. Most people probably wouldn’t want this globally applied so you can set hooks to only do it for the type of files you want to automatically save.
The persistent-scratch
package does just what it says. It will save your scratch file across Emacs sessions. That’s handy for folks who actually use it to take notes and don’t want to lose those notes when they restart Emacs.
Finally, session
saves things like the values you’ve stored in registers. Follow the link to see a list of all the things that session saves. I’ve never been a fan of this sort of thing but many people are so if you’re one of them, take a look at the package.
The video is only 6 minutes, 17 seconds long so you can probably watch it while you’re waiting for your coffee to cool. These packages are good examples of small Emacs apps that help you adapt Emacs to work the way you want it to.