5

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?

1 Answer 1

8

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

Solution was to execute:

fg %emacs 
3
  • 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). Oct 30, 2012 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. Oct 30, 2012 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). Nov 6, 2012 at 2:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .