A directory titled auto-save-list
appeared in my .emacs.d
folder. In my init.el
file, I did not explicitly mention I want this folder to be made. What is the purpose of this folder? I noticed it seems to always be empty: files being auto-saved (starting with #
) appear wherever the original file being edited is, not in the auto-save-list
directory.
If you search the manual or its index for auto-save-list
you will find:
Emacs records information about interrupted sessions in files named ‘.saves-PID-HOSTNAME’ in the directory ‘~/.emacs.d/auto-save-list/’. This directory is determined by the variable ‘auto-save-list-file-prefix’. If you set ‘auto-save-list-file-prefix’ to ‘nil’, sessions are not recorded for recovery.
– C-hig (emacs)Recover
RET
I did not explicitly mention I want this folder to be made.
Emacs and elisp libraries in general write to ~/.emacs.d/
when they need to save data. That's one of the purposes of this directory -- to provide a common place for such files to be written to; and this typically happens without asking explicit permission (although it's also pretty common for you to be able to customize the filename in question if you so wish).
phils already answered the specific question, but to answer the more general question of what to do about miscellaneous files automatically created by Emacs, check out the no-littering package.
Auto save files (the ones with '#') are not handled by no-littering, but the readme gives a work around for those if you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With