Sometimes I wish to persist the value of some variable when I quit emacs. For example, I would like to do this for
Now, I guess I could find the hook that is run when Emacs quits (assuming there is one, a quick scan through the list of hooks did not turn up an obvious candidate) and save that variable to a file of my own; and reload it in
init.el. But surely someone else had the same need already. Is there a package or even some inbuilt way to achieve this?
Bonus question: it would be awesome to also be able to save the history of the same. I.e., when I type
M-x compile, I can scroll back through the previous compile commands. Would be great to keep that. Same for
M-! with shell commands and so on.