There are files like session.10110ac205e127d7e2143131143297155100000021880037
in my .emacs.d
folder. I would like to do something about it but could not figure out what to do.
- What are these files for ?
- Why emacs generate multiple files ?
These are saved session files which emacs dumps when the window manager notifies it that it is shutting down. See the function emacs-session-save
. There are multiple files because they are suffixed by the X session ID. Are you by chance in the habit of quitting your window manager before you exit emacs?
There is a movement to clean up this kind of litter of files in .emacs.d
:
emacscollective/no-littering: Help keeping ~/.emacs.d clean
This issue has been addressed to some degree by emacs-session: theme emacs-session-filename (#38) by DamienCassou · Pull Request #39 · emacscollective/no-littering but I think it simply puts the files in a subdirectory of .emacs.d
This still doesn't address the underlying question of why empty files are being left around. (Yes - for me, all 84 session.*
files are empty. And yes, I don't bother exiting emacs before shutting down - I just run (desktop-save-in-desktop-dir)
)