Suppose I’m entering a bunch of text in a buffer that’s not visiting a file (it could be a new org2blog post, or just some scratch buffer). Is it possible to autosave it somewhere in case disaster strikes and Emacs dies?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
auto-save-modeactually works with non-file buffers. It just doesn’t get enabled by default — that usually happens in(after-find-file).So: M-x
auto-save-modeRETBy default the auto-save file will be written to the
default-directoryof the buffer (or/var/tmpor~/, depending on write permissions; see C-hvbuffer-auto-save-file-nameRET) which may be a little awkward to figure out after a crash, so setting that to something standard is probably a good idea.The following would ensure that these auto-save files are written to your home directory (or M-x
customize-variableRETmy-non-file-buffer-auto-save-dirRET), ifauto-save-modeis invoked interactively. That will hopefully avoid this conflicting with any other uses ofauto-save-modewith non-file buffers (the code mentions Mail mode, for instance).