2

I was trying to save in Emacs and pushed something wrong and Emacs closed. Judging by

ps aux | grep emacs

the emacs process is still running with the file I need to save running. (Opening the file in new emacs process complains that the file is used by another emacs process).

How can I reattach to the running Emacs session or at least make it save its work before I kill it?

5

Found out I was pushing Ctrl-x, Ctrl-z.

Solution was to execute:

fg %emacs 
|improve this answer|||||
  • I only have to hit C-z to suspend emacs, and then fg to resume it. It should be possible to disable this with stty susp '' (as it's very easy to mistype, that'd be great) but it is not working for me (i.e., still possible to suspend). – Emanuel Berg Oct 30 '12 at 18:47
  • 1
    @EmanuelBerg stty susp only applies when the terminal is in cooked mode. Emacs put the terminal in raw mode and handles combinations like Ctrl+Z internally. – Gilles 'SO- stop being evil' Oct 30 '12 at 22:59
  • 1
    To disable this, in .emacs, put: (put 'suspend-frame 'disabled t) - but, if you accidentally mistype, you'll still get an annoying popup message saying it is disabled, so use C-h f suspend-frame RET to find out what keys will do it, then (in my case) (global-set-key (kbd "C-z") nil) and (global-set-key (kbd "C-x C-z") nil). – Emanuel Berg Nov 6 '12 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.