johnsu01 (johnsu01) wrote,

Recovering from oops in Emacs

I have a bad habit of hitting C-Alt-Backspace by accident and restarting my X session. Often this happens when I'm going for C-Alt-\ to fix some indentation. Other times, it just happens for a cosmic reason I can't explain.

Fortunately, Emacs does an excellent job of auto-saving things, so this rarely turns out to be more than an inconvenience. Today it happened and I ended up with 53 auto-save files. I wasn't about to go through and recover each by hand.

To recover, I do:

M-x recover-session

Then, move to the line of the appropriate session and do:

M-x recover-session-finish

It prompts twice for each file. You can cut that down to once by hitting "!" at the first yes/no prompt. I believe that recover-session-finish is bound to C-c C-c when you are in the buffer that lists all the possible sessions to recover.

Tags: emacs
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.