Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

purpose of ~/.emacs.d/auto-save-list/

Tags:

emacs

autosave

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.

like image 959
Oliver Angelil Avatar asked Mar 07 '23 06:03

Oliver Angelil


2 Answers

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).

like image 59
phils Avatar answered Mar 21 '23 09:03

phils


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.

like image 21
jpkotta Avatar answered Mar 21 '23 09:03

jpkotta