1

I was using emacs (XEmacs actually) and using the scratch buffer to experiment with regular expressions for a regex-replace operation that was giving me trouble. That has nothing to do with the problem, just setting the context.

A power failure caused me to have to reboot my computer and restart emacs. Because scratch can't be saved without explicitly copying it to a file, it's gone.

Is there any way to recover the previous (before the power failure) contents of scratch and, if so, how do I do it?

I'm not looking for suggestions for how to prevent this from being a problem in the future---I've figured that out. I just want restore the scratch contents that I just lost, if possible.

Drew
  • 75,699
  • 9
  • 109
  • 225
Byron Dom
  • 33
  • 4

1 Answers1

3

Buffers that are not saved to a file are just kept in memory. The contents of memory are lost on a reboot¹, so these buffers are gone. If you had a core dump, or a copy of your memory (such as you might get if you suspended your computer to disk), then perhaps you could recover it. Otherwise, no.

¹ Technically memory can remain readable for a few minutes without power if you freeze the ram using propellant from a can of compressed air, liquid nitrogen, or some other means. But you’re probably not set up for that on short notice.

db48x
  • 15,741
  • 1
  • 19
  • 23