I frequently run shell sessions under Emacs (via C-x shell
). My practice is to turn auto-saving on these shell-interaction buffers, so that the resulting (auto-saved) files serve as a persistent record of what I've done (including all the generated output).
This works pretty well most of the time, but occasionally, Emacs deletes the auto-saved file.
The conditions that lead to such deletions are not entirely clear to me, but in any case, I would like to prevent them altogether.
Is there a way to tell Emacs to never delete an auto-saved file?
I realize that here I am probably using Emacs' auto-save feature in a way that is very far from the standard use-case for this feature, and therefore, it may be unreasonable to try to do what I am asking about here (i.e. keeping Emacs from deleting an auto-saved file). If so, is there some other way to have Emacs periodically save a shell-interaction buffer to disk, and never deleting the target file?